Skip to content

Commit

Permalink
Fix build without QT_IMPLICIT_QCHAR_CONSTRUCTION
Browse files Browse the repository at this point in the history
  • Loading branch information
K900 authored and john-preston committed Oct 11, 2024
1 parent 25301a3 commit 4155b9a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit 4155b9a

Please sign in to comment.