aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-07-11 16:04:17 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-07-12 08:04:58 +0000
commitbdebb54522f82a9d18d231a183fffaadd6e3479e (patch)
tree5914430c8d53c93791525b7cf45f38062795365b /tests
parentb9637d71b391c165b8e6b1177e1ca1dc81557d76 (diff)
QQuickPopup: add reset-method for parent
Change-Id: Ia7d205bacf4da4cb13e31ab34fb62d13a77f7ddd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/popup/tst_popup.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/popup/tst_popup.cpp b/tests/auto/popup/tst_popup.cpp
index 7566ceff..16cdcbef 100644
--- a/tests/auto/popup/tst_popup.cpp
+++ b/tests/auto/popup/tst_popup.cpp
@@ -407,6 +407,28 @@ void tst_popup::windowChange()
popup.setParentItem(window.contentItem());
QCOMPARE(popup.window(), &window);
QCOMPARE(spy.count(), 3);
+
+ popup.resetParentItem();
+ QVERIFY(!popup.window());
+ QCOMPARE(spy.count(), 4);
+
+ popup.setParent(&window);
+ popup.resetParentItem();
+ QCOMPARE(popup.window(), &window);
+ QCOMPARE(spy.count(), 5);
+
+ popup.setParent(this);
+ popup.resetParentItem();
+ QVERIFY(!popup.window());
+ QCOMPARE(spy.count(), 6);
+
+ item.setParentItem(window.contentItem());
+ popup.setParent(&item);
+ popup.resetParentItem();
+ QCOMPARE(popup.window(), &window);
+ QCOMPARE(spy.count(), 7);
+
+ popup.setParent(nullptr);
}
Q_DECLARE_METATYPE(QQuickPopup::ClosePolicy)