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 into scope. Each your screen should be able to reach the Windows id (make sure to never use it again) *Main.qml* *Window * *{ * * id: windowsUniqueId_* * property var appData* * Screen1 {}* * Screen2 {}* *}* *Screen1,2,3.qml:* *Rectangle* *{* * property var screenData: windowsUniqueId_.appData* *}* Note: If your data are js dictionary make sure to merge left or right the data before assignation. On Tue, Jan 6, 2015 at 2:02 PM, Jason H <jh...@gmx.com> wrote: > 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 }, onExit: { > appData.screen2 = screen2.screenData }} > Screen3 { onEnter: { screen3.screenData = appData.screen3 }, onExit: { > appData.screen3 = screen3.screenData }} > } > > Screen1,2,3.qml: > Rectangle { > property var screenData; > } > > I'd like to just have the screens and Window reference the same variable > so I don't have to keep moving the data around because now I have async > things (data load) happening between screens. > > > Thanks > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest