diff --git a/codegen/emoji/replaces.cpp b/codegen/emoji/replaces.cpp index 2d26fbb..ce0d342 100644 --- a/codegen/emoji/replaces.cpp +++ b/codegen/emoji/replaces.cpp @@ -85,11 +85,11 @@ bool AddReplacement(Replaces &result, const Id &id, const QString &replacement, return true; } -QString ComposeString(const std::initializer_list &chars) { +QString ComposeString(const std::initializer_list &chars) { auto result = QString(); result.reserve(chars.size()); for (auto ch : chars) { - result.append(ch); + result.append(QChar(ch)); } return result; } @@ -119,10 +119,10 @@ const auto NotSupported = [] { const auto ConvertMap = ([] { auto result = QMap(); - auto insert = [&result](const std::initializer_list &from, const std::initializer_list &to) { + auto insert = [&result](const std::initializer_list &from, const std::initializer_list &to) { result.insert(ComposeString(from), ComposeString(to)); }; - auto insertWithAdd = [&result](const std::initializer_list &from, const QString &added) { + auto insertWithAdd = [&result](const std::initializer_list &from, const QString &added) { auto code = ComposeString(from); result.insert(code, code + added); }; diff --git a/codegen/lang/generator.cpp b/codegen/lang/generator.cpp index b8be5e8..c12de72 100644 --- a/codegen/lang/generator.cpp +++ b/codegen/lang/generator.cpp @@ -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; } } diff --git a/codegen/style/generator.cpp b/codegen/style/generator.cpp index f12b79c..5cab58c 100644 --- a/codegen/style/generator.cpp +++ b/codegen/style/generator.cpp @@ -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) {