Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build without QT_IMPLICIT_QCHAR_CONSTRUCTION #20

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions codegen/emoji/replaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ bool AddReplacement(Replaces &result, const Id &id, const QString &replacement,
return true;
}

QString ComposeString(const std::initializer_list<QChar> &chars) {
QString ComposeString(const std::initializer_list<int> &chars) {
auto result = QString();
result.reserve(chars.size());
for (auto ch : chars) {
result.append(ch);
result.append(QChar(ch));
}
return result;
}
Expand Down Expand Up @@ -119,10 +119,10 @@ const auto NotSupported = [] {

const auto ConvertMap = ([] {
auto result = QMap<QString, QString>();
auto insert = [&result](const std::initializer_list<QChar> &from, const std::initializer_list<QChar> &to) {
auto insert = [&result](const std::initializer_list<int> &from, const std::initializer_list<int> &to) {
result.insert(ComposeString(from), ComposeString(to));
};
auto insertWithAdd = [&result](const std::initializer_list<QChar> &from, const QString &added) {
auto insertWithAdd = [&result](const std::initializer_list<int> &from, const QString &added) {
auto code = ComposeString(from);
result.insert(code, code + added);
};
Expand Down
2 changes: 1 addition & 1 deletion codegen/lang/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ QChar DefaultData[] = {";
}
source_->stream() << " ";
}
source_->stream() << "0x" << QString::number(ch.unicode(), 16);
source_->stream() << "QChar(0x" << QString::number(ch.unicode(), 16) << ")";
++fulllength;
}
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/style/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ QString colorFallbackName(structure::Value value) {
QChar paletteColorPart(uchar part) {
part = (part & 0x0F);
if (part >= 10) {
return 'a' + (part - 10);
return QChar('a' + (part - 10));
}
return '0' + part;
return QChar('0' + part);
}

QString paletteColorComponent(uchar value) {
Expand Down