diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-05-24 16:28:54 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-06 16:51:07 +0200 |
commit | a26d7aef3ce61ac0515cf8a324c8badd13bdb017 (patch) | |
tree | 1dd22962a7c40df451ae7f9465cf2ca4e4185cb7 /tests/auto | |
parent | 1fcb3d512c37625e6dfdbd045c755e8d6aca8c57 (diff) |
Disallow parent changes for QML created objects
Currently this is protected with a QML_PARENT_TEST environment variable
to allow the rest of QtQuick to be updated before it is enforced.
Change-Id: I4dd3644cbbce91d67f24c9556637f97eafb00638
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/signalEmitted.qml | 36 | ||||
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp | 2 |
3 files changed, 0 insertions, 48 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/signalEmitted.qml b/tests/auto/qml/qqmlecmascript/data/signalEmitted.qml deleted file mode 100644 index 6de606e62b..0000000000 --- a/tests/auto/qml/qqmlecmascript/data/signalEmitted.qml +++ /dev/null @@ -1,36 +0,0 @@ -import QtQuick 2.0 -import Qt.test 1.0 as ModApi - -Item { - id: root - - property bool success: false - property bool c1HasBeenDestroyed: false - - Item { - id: container - - SignalEmittedComponent { - id: c1 - } - - SignalEmittedComponent { - id: c2 - property int c1a: if (c1) c1.a; else 0; // will change during onDestruction handler of c1. - onC1aChanged: { - // this should still be called, after c1 has been destroyed. - if (root.c1HasBeenDestroyed && c1a == 20) c1.setSuccessPropertyOf(root, true); - } - } - } - - Component.onCompleted: { - // firstly, reparent c2 so that it doesn't get destroyed. - ModApi.changeQObjectParent(c2); - - // then, destroy container (and thus also c1) - c1HasBeenDestroyed = true; - container.destroy(); - // return to event loop. - } -} diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 18743ac57d..d34a8402c3 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -6860,16 +6860,6 @@ void tst_qqmlecmascript::bindingSuppression() void tst_qqmlecmascript::signalEmitted() { { - // calling destroy on the parent. - QQmlEngine engine; - QQmlComponent c(&engine, testFileUrl("signalEmitted.qml")); - QObject *obj = c.create(); - QVERIFY(obj != 0); - QTRY_VERIFY(obj->property("success").toBool()); - delete obj; - } - - { // calling destroy on the sibling. QQmlEngine engine; QQmlComponent c(&engine, testFileUrl("signalEmitted.2.qml")); diff --git a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp index b4c83b35aa..77de47dba9 100644 --- a/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp +++ b/tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp @@ -339,7 +339,6 @@ void tst_qqmlinstruction::dump() { QQmlCompiledData::Instruction::StoreValueSource i; i.property.coreIndex = 29; - i.owner = 1; i.castValue = 4; data->addInstruction(i); } @@ -347,7 +346,6 @@ void tst_qqmlinstruction::dump() { QQmlCompiledData::Instruction::StoreValueInterceptor i; i.property.coreIndex = 30; - i.owner = 2; i.castValue = -4; data->addInstruction(i); } |