QDeclarativeContext * pContext = rootContext();
if (pContext)
{
- pContext->setContextProperty("clocksPage.applicationActive", false);
+ QObject * pObject = pContext->contextObject();
+
+ if (pObject)
+ {
+ pObject->setProperty("applicationActive",false);
+// pContext->setContextProperty("clocksPage.applicationActive", false);
qDebug() << "Window deactivated";
+ }
+ else qDebug() << "No context object!" << pContext->isValid();
+// QDeclarativeEngine * pEngine = engine();
+// engine()->
}
}
{
id: clocksPage
- property bool applicationActive: true //This is supposed to be set from C++
property int timeControl //properties cannot be declared as enumerations in QML
//...must be a valid enum from WrappedClocksWidget
wrappedClocksWidget.startGame(timeControl,whiteInitialTime,whiteAdditionalTime,whiteTurnsPerAddition,blackInitialTime,blackAdditionalTime,blackTurnsPerAddition)
}
- onApplicationActiveChanged:
- {
- if (applicationActive == false)
- wrappedClocksWidget.pause()
-
-
- }
tools: ToolBarLayout
PageStackWindow {
id: appWindow
+
+ property bool applicationActive: true //This is supposed to be set from C++
+
+ onApplicationActiveChanged:
+ {
+ if (applicationActive == false)
+ wrappedClocksWidget.pause()
+ theme.inverted = false
+ }
+
+
Component.onCompleted: theme.inverted = true
initialPage: mainPage