QML Page Loading/Navigating Question
-
I see three potential options for navigating between QML pages in our application and I am wondering which would be the most performant. Also how would context be handled in each?
-
Use a Loader element that gets passed the source of the new qml page when a button is clicked: onClicked: pageModel.changePage("pages/gpsSystemPage.qml")
-
Have one qml page that treats every page like a component and transitions them into the viewport using states.
-
Use QDeclarativeEngine or QDeclarativeComponent to load each of the qml pages from the C++ portion of the application.
Any thoughts would be appreciated.
-
-
If we were to assume no transitions, is that option the least memory intensive?
-
I don't know anything about how the qml engine works but I have to guess/believe that #3 is probably the least memory intensive. #2 should be the worst from a memory perspective. #1 is probably either like #3 (hopefully free all the memory used by the previous pages when they are out of scope) or like #2 (all the components are still in the scope).