diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-01 16:14:30 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-09-07 16:57:16 +0200 |
commit | d3b3fef5a878d7fd53de6a9f9fff196a273930e3 (patch) | |
tree | 76b96ff3d6f34a01bf4a9881dd75626921c49daf /tests/auto/qml/qqmlecmascript/data | |
parent | 5cda89ce030ff5fbc9e95be1b9ca74adb401a9d7 (diff) |
Qml: Allow const and non-const QObjectWrappers to coexist
We can access the same QObject in const and non-const contexts. Both
should be possible. Store the const objectwrapper in
m_multiplyWrappedObjects. That's somewhat slow, but const QObjects are
rather rare.
Pick-to: 6.4
Fixes: QTBUG-98479
Change-Id: I047afc121f5c29b955cd833e0a2c8299fc52b021
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/frozenQObject2.qml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/frozenQObject2.qml b/tests/auto/qml/qqmlecmascript/data/frozenQObject2.qml new file mode 100644 index 0000000000..ebff0cde8b --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/frozenQObject2.qml @@ -0,0 +1,19 @@ +import QtQml +import test + +FrozenObjects { + id: app; + + property bool caughtSignal: false + onFooMember2Emitted: caughtSignal = true + + Component.onCompleted: { + app.fooMember.name = "John"; + app.fooMemberConst; + app.fooMember.name = "Jane"; + + app.fooMember2.name = "John"; + app.triggerSignal(); + app.fooMember2.name = "Jane"; + } +} |