[Interest] QML global variables?

Jason H jhihn at gmx.com
Tue Jan 6 20:02:20 CET 2015


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



More information about the Interest mailing list