summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorCarl Schwan <carl.schwan@kdab.com>2023-01-27 14:25:59 +0100
committerCarl Schwan <carl.schwan@kdab.com>2023-03-06 12:14:16 +0100
commit34b48cd4f7fed202fffca08b5943eb82cf335b74 (patch)
tree16520fdd90a3f65a9c6aab675de6c9d91183b286 /tools
parent5e889436ddcc7675c6aea61998cf010cd9d5c4a2 (diff)
Support QT_NO_CAST_FROM_ASCII in generated code
This is needed as the generated code will be included in targets with possibly QT_NO_CAST_FROM_ASCII set. Change-Id: Ic71e729657fbe2c0c402c86439e633cf6102e358 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/repc/repcodegenerator.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/repc/repcodegenerator.cpp b/tools/repc/repcodegenerator.cpp
index ed61d67..d544268 100644
--- a/tools/repc/repcodegenerator.cpp
+++ b/tools/repc/repcodegenerator.cpp
@@ -269,6 +269,9 @@ void RepCodeGenerator::generateHeader(Mode mode)
m_stream << m_ast.preprocessorDirectives.join(QLatin1Char('\n'));
m_stream << "\n";
+
+ m_stream << "using namespace Qt::Literals::StringLiterals;";
+ m_stream << "\n";
}
static QString formatTemplateStringArgTypeNameCapitalizedName(int numberOfTypeOccurrences,
@@ -664,13 +667,13 @@ void RepCodeGenerator::generateClass(Mode mode, const ASTClass &astClass,
if (astClass.subClassPropertyIndices.contains(index))
m_stream << QString::fromLatin1(" setChild(%1, QVariant::fromValue("
"node->acquire<%2Replica>(QRemoteObjectStringLiterals::CLASS()"
- ".arg(\"%3\"))));")
+ ".arg(u\"%3\"_s))));")
.arg(QString::number(index), property.type, acquireName)
<< Qt::endl;
else
m_stream << QString::fromLatin1(" setChild(%1, QVariant::fromValue("
"node->acquireModel(QRemoteObjectStringLiterals::MODEL()"
- ".arg(\"%2\"))));")
+ ".arg(u\"%2\"_s))));")
.arg(QString::number(index), acquireName) << Qt::endl;
m_stream << " Q_EMIT " << property.name << "Changed(" << property.name
<< "()" << ");" << Qt::endl;
@@ -693,12 +696,12 @@ void RepCodeGenerator::generateClass(Mode mode, const ASTClass &astClass,
if (astClass.subClassPropertyIndices.contains(index))
m_stream << QString::fromLatin1(" setChild(%1, QVariant::fromValue("
"node->acquire<%2Replica>(QRemoteObjectStringLiterals::CLASS()"
- ".arg(\"%3\"))));")
+ ".arg(u\"%3\"_s))));")
.arg(QString::number(index), property.type, acquireName) << Qt::endl;
else
m_stream << QString::fromLatin1(" setChild(%1, QVariant::fromValue("
"node->acquireModel(QRemoteObjectStringLiterals::MODEL()"
- ".arg(\"%2\"))));")
+ ".arg(u\"%2\"_s))));")
.arg(QString::number(index), acquireName) << Qt::endl;
}
m_stream << " }" << Qt::endl;