aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-01-21 15:42:14 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-21 23:26:21 +0000
commit415ef1504349f08d0c0868995de3b43ef6c027f1 (patch)
tree5e4cd8187bcd0a2a85eabba555972e1a8aadd4e4 /tests
parent9459fab5c7c56e0bf09c887d176ff447ca2b6e83 (diff)
QQmlProperty: Prohibit ID lookup on explicitly given object
If an object is given, we should only use that object. Amends commit 21f15ede606df028479335c64c333db5fb1bb3f7. Task-number: QTBUG-100110 Change-Id: I51c0a44750c31984ba4937fb1cd2405dd93fcc19 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 44ca135c5a4d02ab29b57a3f15b84850aafb1cec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index 0d6f0d8d61..dd5d466a49 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -2475,6 +2475,8 @@ void tst_qqmlproperty::initFlags()
const bool hasSignal = name.endsWith(QStringLiteral("foo"));
if (!passObject && !usesId) {
QVERIFY(!property.isValid());
+ } else if (passObject && usesId) {
+ QVERIFY(!property.isValid());
} else if (usesId && !(flags & QQmlPropertyPrivate::InitFlag::AllowId)) {
QVERIFY(!property.isValid());
} else if (hasSignal && !(flags & QQmlPropertyPrivate::InitFlag::AllowSignal)) {