aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickitem
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-10-31 01:01:32 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-10-31 09:44:09 +0100
commit9c050d452961f348c8bcc33e3422aed6316bb18b (patch)
treeb8af41758d885bfad84ccbd52e24eb1544908fda /tests/auto/quick/qquickitem
parent59760e6ce0da6780fcbdf0b2dc123f989baaa3eb (diff)
parentbcbc3c9cec1f7d7bb8c9d5f5ea94eb5c81ec2853 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts: .qmake.conf src/qml/common/qv4compileddata_p.h src/qml/types/qqmlbind.cpp tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp Change-Id: I6a137907e63445f17a3d6181b832a6bd76135bb2
Diffstat (limited to 'tests/auto/quick/qquickitem')
-rw-r--r--tests/auto/quick/qquickitem/data/setParentInWindowChange.qml12
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp8
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickitem/data/setParentInWindowChange.qml b/tests/auto/quick/qquickitem/data/setParentInWindowChange.qml
new file mode 100644
index 0000000000..d68b7adb72
--- /dev/null
+++ b/tests/auto/quick/qquickitem/data/setParentInWindowChange.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.12
+
+Rectangle {
+ width: 800
+ height: 600
+ Item {
+ id: it
+ onWindowChanged: () => it.parent = newParent
+ }
+
+ Item { id: newParent }
+}
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index b6e40d5117..8aab13e095 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -197,6 +197,8 @@ private slots:
void qtBug60123();
#endif
+ void setParentCalledInOnWindowChanged();
+
private:
enum PaintOrderOp {
@@ -2146,6 +2148,12 @@ void tst_qquickitem::qtBug60123()
activateWindowAndTestPress(&window);
}
#endif
+void tst_qquickitem::setParentCalledInOnWindowChanged()
+{
+ QQuickView view;
+ view.setSource(testFileUrl("setParentInWindowChange.qml"));
+ QVERIFY(ensureFocus(&view)); // should not crash
+}
QTEST_MAIN(tst_qquickitem)