Re: [Interest] QML global variables?

2015-01-06 Thread Jérôme Godbout
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. > >

Re: [Interest] QML global variables?

2015-01-06 Thread Jason H
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

Re: [Interest] QML global variables?

2015-01-06 Thread Jérôme Godbout
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

[Interest] QML global variables?

2015-01-06 Thread Jason H
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