diff options
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 984881c8da..b09f80a634 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -304,6 +304,7 @@ private slots: void qmlCreation(); void clearColor(); + void defaultState(); void grab_data(); void grab(); @@ -955,6 +956,25 @@ void tst_qquickwindow::clearColor() QCOMPARE(window->color(), QColor(Qt::blue)); } +void tst_qquickwindow::defaultState() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + component.setData("import QtQuick 2.0; import QtQuick.Window 2.1; Window { }", QUrl()); + QObject *created = component.create(); + QScopedPointer<QObject> cleanup(created); + QVERIFY(created); + + QQuickWindow *qmlWindow = qobject_cast<QQuickWindow*>(created); + QVERIFY(qmlWindow); + + QQuickWindow cppWindow; + cppWindow.show(); + QTest::qWaitForWindowExposed(&cppWindow); + + QCOMPARE(qmlWindow->windowState(), cppWindow.windowState()); +} + void tst_qquickwindow::grab_data() { QTest::addColumn<bool>("visible"); |