diff options
author | Liang Qi <liang.qi@qt.io> | 2017-06-07 12:06:14 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-06-07 12:06:15 +0200 |
commit | 55490690f81eba168b06a90e4a66cefc20b38252 (patch) | |
tree | 9c6b6b9234aa767af1c69cac4d4cf896f292be20 /tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | |
parent | 5624e82d068ebab254239121810fc097af7fcb40 (diff) | |
parent | d8f84e5769632544dfac5138348481330c4da4cd (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I61ab3d0bd8cc02f640c60c037226eace09ec09ba
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index f2eb6a6685..91d577fb6f 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -375,7 +375,7 @@ private slots: void testDragEventPropertyPropagation(); - void createTextureFromImage(); + void findChild(); private: QTouchDevice *touchDevice; @@ -2827,13 +2827,26 @@ void tst_qquickwindow::testDragEventPropertyPropagation() } } -void tst_qquickwindow::createTextureFromImage() +void tst_qquickwindow::findChild() { - // An invalid image should return a null pointer. QQuickWindow window; - window.show(); - QTest::qWaitForWindowExposed(&window); - QVERIFY(!window.createTextureFromImage(QImage())); + + // QQuickWindow + // |_ QQuickWindow::contentItem + // | |_ QObject("contentItemChild") + // |_ QObject("viewChild") + + QObject *windowChild = new QObject(&window); + windowChild->setObjectName("windowChild"); + + QObject *contentItemChild = new QObject(window.contentItem()); + contentItemChild->setObjectName("contentItemChild"); + + QCOMPARE(window.findChild<QObject *>("windowChild"), windowChild); + QCOMPARE(window.findChild<QObject *>("contentItemChild"), contentItemChild); + + QVERIFY(!window.contentItem()->findChild<QObject *>("viewChild")); // sibling + QCOMPARE(window.contentItem()->findChild<QObject *>("contentItemChild"), contentItemChild); } QTEST_MAIN(tst_qquickwindow) |