[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 =

Re: [Interest] QML global variables?

2015-01-06 Thread Jérôme 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* At the beginning of Settings.qml

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

Re: [Interest] QML global variables?

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