diff options
| author | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-05-16 10:12:46 +0200 |
|---|---|---|
| committer | Olivier De Cannière <olivier.decanniere@qt.io> | 2025-05-31 10:36:42 +0200 |
| commit | a35b0e44ae01aa94d4d9a5d34650d3af0743be15 (patch) | |
| tree | d23fbc1f0e3fb9383d13101c3800531de27b1bb3 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 455f3169e348e39aeea3c24f6a53103a816d7d20 (diff) | |
Qml: Allow accessing unscoped enums values as <Component>.<Enum>.<Key>
[ChangeLog][QML] It is now possible to access unscoped enum values in a
scoped way as <component name>.<enum name>.<key>. Previously, it was
only possible to access them in an unscoped way.
Task-number: QTBUG-116513
Change-Id: Iff56cd3365516215e1e195a147fae66ee17d39e3
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 | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 6f2a8f4b51..ffd18f09a7 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -4890,23 +4890,17 @@ void tst_QmlCppCodegen::scopedEnum() QTest::ignoreMessage( QtWarningMsg, qPrintable(url + u":6:5: Unable to assign [undefined] to int"_s)); - QTest::ignoreMessage( - QtWarningMsg, - qPrintable(url + u":8: TypeError: Cannot read property 'C' of undefined"_s)); - QTest::ignoreMessage( - QtWarningMsg, - qPrintable(url + u":14: TypeError: Cannot read property 'C' of undefined"_s)); QScopedPointer<QObject> object(component.create()); QVERIFY(!object.isNull()); QCOMPARE(object->property("good").toInt(), 27); QCOMPARE(object->property("bad").toInt(), 0); - QCOMPARE(object->property("wrong").toInt(), 0); + QCOMPARE(object->property("noLongerWrong").toInt(), 7); QCOMPARE(object->property("right").toInt(), 7); QCOMPARE(object->property("notgood").toInt(), 26); QCOMPARE(object->property("notbad").toInt(), 26); - QCOMPARE(object->property("notwrong").toInt(), 0); + QCOMPARE(object->property("notwrongAnymore").toInt(), 6); QCOMPARE(object->property("notright").toInt(), 6); QCOMPARE(object->property("passable").toInt(), 2); |
