diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-09-22 15:01:27 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-09-22 13:31:02 +0000 |
commit | f17b826a72d77379288aa84a933b9231c279cbad (patch) | |
tree | f1e95ca5d2ad6ccc28dc6caf040d740bb2e26b13 /tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp | |
parent | 163c515783877b8b0ffb8b5c1bab288addee9745 (diff) |
Fix behaviors not working when sub-types declare properties
Since commit 81867dfbf9c16d4300727a08eed9b5c6c979e0ba we have an
optimization in place to avoid the virtual meta-call when writing
properties that cannot be intercepted. Unfortunately that check did not
take parent VME meta-objects into account, which triggered the bug.
Test case by Harald Hvaal <hhvaal@cisco.com>
Task-number: QTBUG-63365
Change-Id: I66cb2967da2c09ca5e38cebd9db2ee6e3ee78f5f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp')
-rw-r--r-- | tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp index 80c76a377b..bdd53702e5 100644 --- a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp +++ b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp @@ -72,6 +72,7 @@ private slots: void currentValue(); void disabledWriteWhileRunning(); void aliasedProperty(); + void innerBehaviorOverwritten(); }; void tst_qquickbehaviors::simpleBehavior() @@ -589,6 +590,14 @@ void tst_qquickbehaviors::aliasedProperty() //i.e. the behavior has been triggered } +void tst_qquickbehaviors::innerBehaviorOverwritten() +{ + QQmlEngine engine; + QQmlComponent c(&engine, testFileUrl("overwrittenbehavior.qml")); + QScopedPointer<QQuickItem> item(qobject_cast<QQuickItem*>(c.create())); + QVERIFY(item->property("behaviorTriggered").toBool()); +} + QTEST_MAIN(tst_qquickbehaviors) #include "tst_qquickbehaviors.moc" |