aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickwindow')
-rw-r--r--tests/auto/quick/qquickwindow/data/windowattached.qml4
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml
index 0e3f1d4b62..a9f052d55e 100644
--- a/tests/auto/quick/qquickwindow/data/windowattached.qml
+++ b/tests/auto/quick/qquickwindow/data/windowattached.qml
@@ -7,6 +7,8 @@ Rectangle {
height: 100
property bool windowActive: root.Window.active
property Item contentItem: root.Window.contentItem
+ property int windowWidth: root.Window.width
+ property int windowHeight: root.Window.height
Text {
objectName: "rectangleWindowText"
anchors.centerIn: parent
@@ -22,6 +24,8 @@ Rectangle {
anchors.centerIn: parent
text: (extraWindow.active ? "active" : "inactive") + "\nvisibility: " + Window.visibility
property Item contentItem: Window.contentItem
+ property int windowWidth: Window.width
+ property int windowHeight: Window.height
}
}
}
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 7c94cf6d17..e019c57ccb 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -1978,6 +1978,8 @@ void tst_qquickwindow::attachedProperty()
QVERIFY(QTest::qWaitForWindowActive(&view));
QVERIFY(view.rootObject()->property("windowActive").toBool());
QCOMPARE(view.rootObject()->property("contentItem").value<QQuickItem*>(), view.contentItem());
+ QCOMPARE(view.rootObject()->property("windowWidth").toInt(), view.width());
+ QCOMPARE(view.rootObject()->property("windowHeight").toInt(), view.height());
QQuickWindow *innerWindow = view.rootObject()->findChild<QQuickWindow*>("extraWindow");
QVERIFY(innerWindow);
@@ -1988,6 +1990,8 @@ void tst_qquickwindow::attachedProperty()
QVERIFY(text);
QCOMPARE(text->text(), QLatin1String("active\nvisibility: 2"));
QCOMPARE(text->property("contentItem").value<QQuickItem*>(), innerWindow->contentItem());
+ QCOMPARE(text->property("windowWidth").toInt(), innerWindow->width());
+ QCOMPARE(text->property("windowHeight").toInt(), innerWindow->height());
}
class RenderJob : public QRunnable