t;
>
> *Sent:* Tuesday, January 06, 2015 at 2:14 PM
> *From:* "Jérôme Godbout"
> *To:* "Jason H"
> *Cc:* "interest@qt-project.org"
> *Subject:* Re: [Interest] QML global variables?
> You can try to use a singleton, seem like what you need.
>
>
correct?
Sent: Tuesday, January 06, 2015 at 2:14 PM
From: "Jérôme Godbout"
To: "Jason H"
Cc: "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
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
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 = appData.screen2