aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2014-11-03 17:23:11 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2014-11-05 16:19:31 +0100
commit77711c65c1fdb6c5d94d26fef828959d29643516 (patch)
tree3a6d0e218f1e24863553d42a988fd225cd6144ab /tests/auto
parent5280e866f76e38f2bf1c226ff896b4649194eec4 (diff)
Add attached Window::contentItem property
This is essential to the Qt Quick Controls for implementing floating text selection handle popups. Change-Id: Ibae65110a5db6d65dacd197fef3ad567d11342dc Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/quick/qquickwindow/data/windowattached.qml2
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml
index e000d5c6fd..0e3f1d4b62 100644
--- a/tests/auto/quick/qquickwindow/data/windowattached.qml
+++ b/tests/auto/quick/qquickwindow/data/windowattached.qml
@@ -6,6 +6,7 @@ Rectangle {
width: 100
height: 100
property bool windowActive: root.Window.active
+ property Item contentItem: root.Window.contentItem
Text {
objectName: "rectangleWindowText"
anchors.centerIn: parent
@@ -20,6 +21,7 @@ Rectangle {
objectName: "extraWindowText"
anchors.centerIn: parent
text: (extraWindow.active ? "active" : "inactive") + "\nvisibility: " + Window.visibility
+ property Item contentItem: Window.contentItem
}
}
}
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 5bd7492d70..043203c256 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -1952,6 +1952,7 @@ void tst_qquickwindow::attachedProperty()
view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QVERIFY(view.rootObject()->property("windowActive").toBool());
+ QCOMPARE(view.rootObject()->property("contentItem").value<QQuickItem*>(), view.contentItem());
QQuickWindow *innerWindow = view.rootObject()->findChild<QQuickWindow*>("extraWindow");
QVERIFY(innerWindow);
@@ -1961,6 +1962,7 @@ void tst_qquickwindow::attachedProperty()
QQuickText *text = view.rootObject()->findChild<QQuickText*>("extraWindowText");
QVERIFY(text);
QCOMPARE(text->text(), QLatin1String("active\nvisibility: 2"));
+ QCOMPARE(text->property("contentItem").value<QQuickItem*>(), innerWindow->contentItem());
}
class RenderJob : public QRunnable