What is the proper way to declare a dynamic global?
Currently my app is set up with
main.qml:
Window {
property var AppData;
Screen1 { onEnter: { screen1.screenData = appData.screen1 }, onExit: {
appData.screen1 = screen1.screenData }}
Screen2 { onEnter: { screen2.screenData =
jer...@bodycad.com
*To:* Jason H jh...@gmx.com
*Cc:* interest@qt-project.org interest@qt-project.org
*Subject:* Re: [Interest] QML global variables?
You can try to use a singleton, seem like what you need.
Inside qmldir:
*singleton Settings 1.0 Settings.qml*
At the beginning of Settings.qml
You can try to use a singleton, seem like what you need.
Inside qmldir:
*singleton Settings 1.0 Settings.qml*
At the beginning of Settings.qml
*pragma Singleton*
*// import goes here*
*QObject*
*{*
*property var appData*
*}*
Then you can use the *Settings.appData*
Or you can use the cascading
, January 06, 2015 at 2:14 PM
From:Jrme Godbout jer...@bodycad.com
To:Jason H jh...@gmx.com
Cc:interest@qt-project.org interest@qt-project.org
Subject:Re: [Interest] QML global variables?
You can try to use a singleton, seem like what you need.
Inside qmldir:
singleton Settings 1.0 Settings.qml