02-06-2013 01:04 PM
What is the best approach for scenario where upon application launch I need to do some pre-processing and display UI which is completely not related with the UI of the application.
Specifically I need to do some database integrity checks (upon app startup) and display user with message / dialogs in event there are db issues.
I would like in my C++ do this logic and if neccessary create QMLDocument root with a specific QML file, and upon action in that QML file return back to C++ and create another QMLDocument with a main application root and QML files.
THis way I would not complicate my main QML tree with unneccessary QML objects which are used only at start up and have a clean separation between main app and the startup process.
Solved! Go to Solution.
02-06-2013 01:35 PM
One approach is to show a Sheet on application start then dismiss and destroy the sheet when it's no longer needed.
You can describe the entire sheet in qml or create a sheet in .cpp, then load a page from qml using QmlDocument then add the page to the sheet and so on. Basically any objects can be instantiated from qml and then destroyed when no longer needed.
It should be also possible to replace Application's scene with another controls hierarchy by calling Application::instance()->setScene() but there will be no transition animation in this case I think. It's possible to animate the transition manually but it'll require more work.
I hope I understand the question correctly.
02-06-2013 01:40 PM
Thank you! Application::instance()->setScene() is what I was looking for. I was using app->setScene() and that was crashing.