View Full Version : Right methodology for 'launcher' type program in QML?

13th March 2011, 05:23

I'm trying to build up a launcher type program in c++/QML. The launcher points to a bunch of different sub-apps in the same program ... each sub-app is also a combination of c++ and QML (sub-apps can be along the line of calculators, text editors, music playback etc). I'd like to take user input (ie. click on some text or an icon), and have the sub-app 'launch' within the program. I created a base layout of my interface in a single QML file. Each app also has its own QML file. Ideally when a user clicks on an app icon, the view would be updated by adding the contents of the apps QML file under an existing component of the QML file.

1) load base layout QML file using QDeclarativeView. There's a menu with icons and a big rectangle where apps should show up.
2) user clicks 'calc' icon --> signal to create c++ calc obj & to [somehow add QML calc file to current view as a child of big rectangle component]

So I guess my question boils down to "how do I dynamically add QML content as children of an existing QML component being displayed using QGraphicsView through QDeclarativeView?"

I'm not sure I'm taking the right approach here by the way, so please feel free to tear my methodology apart. I'm not reloading the entire view every time an app is started because there are persistent components that would be a waste to keep rebuilding (a clock for example).

I'd appreciate any input.