diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-04 15:49:39 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-04 15:55:00 +0100 |
| commit | db6459665c4b4a48db9aefebfe310237e7cc92d9 (patch) | |
| tree | 04dfbbcfdc5be35e1bfb772b0c58bc415828b4d8 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 8fe35a003b04d31f09d3e83a03ffa2843266f9b5 (diff) | |
QmlCompiler: Place code for CmpNeInt in parentheses
Otherwise it will apply the '!' to the first argument.
Fixes: QTBUG-100480
Pick-to: 6.2 6.3
Change-Id: Iaefa25d062ad8bbd9d4278ffeaa52fc53ed417e2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 1a63d28bf5..99376491fd 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -116,6 +116,7 @@ private slots: void popContextAfterRet(); void revisions(); void invisibleBase(); + void notEqualsInt(); }; void tst_QmlCppCodegen::simpleBinding() @@ -1738,6 +1739,20 @@ void tst_QmlCppCodegen::invisibleBase() QCOMPARE(qvariant_cast<QObject *>(o->property("n")), o.data()); } +void tst_QmlCppCodegen::notEqualsInt() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/TestTypes/notEqualsInt.qml"_qs)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + QVERIFY(o); + QObject *t = qmlContext(o.data())->objectForName(u"t"_qs); + QVERIFY(t); + QCOMPARE(t->property("text").toString(), u"Foo"_qs); + QMetaObject::invokeMethod(o.data(), "foo"); + QCOMPARE(t->property("text").toString(), u"Bar"_qs); +} + void tst_QmlCppCodegen::runInterpreted() { if (qEnvironmentVariableIsSet("QV4_FORCE_INTERPRETER")) |
