aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-02-20 11:51:39 +0100
committerUlf Hermann <ulf.hermann@qt.io>2024-02-21 14:27:53 +0100
commit655087e05d6976bdbe91b40017de4062f67fbcca (patch)
tree61b1a95934e1420598328c89a862c426c872af85 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent8f705f0db91155401e50a750f0e7037d13df1d0a (diff)
QmlCompiler: Escape question marks in string literals
This prevents the generation of trigraphs and suppresses the warnings about those. Pick-to: 6.7 Fixes: QTBUG-110772 Change-Id: If30ad39737eae097fdcb18b0d33b6bbfa05be656 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 3092f32b3a..c9ca1387f2 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -225,6 +225,7 @@ private slots:
void throwObjectName();
void topLevelComponent();
void translation();
+ void trigraphs();
void trivialSignalHandler();
void typePropagationLoop();
void typePropertyClash();
@@ -4496,6 +4497,15 @@ void tst_QmlCppCodegen::translation()
QCOMPARE(o->property("trIdNoop1"), u"s"_s);
}
+void tst_QmlCppCodegen::trigraphs()
+{
+ QQmlEngine e;
+ QQmlComponent c(&e, QUrl(u"qrc:/qt/qml/TestTypes/trigraphs.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QCOMPARE(o->objectName(), u"?""?= ?""?/ ?""?' ?""?( ?""?) ?""?! ?""?< ?""?> ?""?-"_s);
+}
+
void tst_QmlCppCodegen::trivialSignalHandler()
{
QQmlEngine engine;