void state();
void layoutDirection();
void inputMethod();
+ void cleanup();
private:
QQmlEngine engine;
{
}
+void tst_qquickapplication::cleanup()
+{
+ if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)) {
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
+ QTest::waitForEvents();
+ }
+}
+
void tst_qquickapplication::active()
{
QQmlComponent component(&engine);
QVERIFY(item->property("active").toBool());
QVERIFY(item->property("active2").toBool());
- // not active again
QWindowSystemInterface::handleWindowActivated(0);
+#ifdef Q_OS_OSX
+ // OS X has the concept of "reactivation"
+ QTRY_VERIFY(QGuiApplication::focusWindow() != &window);
+ QVERIFY(item->property("active").toBool());
+ QVERIFY(item->property("active2").toBool());
+#else
+ // not active again
QTRY_VERIFY(QGuiApplication::focusWindow() != &window);
QVERIFY(!item->property("active").toBool());
QVERIFY(!item->property("active2").toBool());
+#endif
}
void tst_qquickapplication::state()
" target: Qt.application; "
" onStateChanged: state2 = Qt.application.state; "
" } "
+ " Component.onCompleted: state2 = Qt.application.state; "
"}", QUrl::fromLocalFile(""));
QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
QVERIFY(item);