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?

    1. 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")

    2. Have one qml page that treats every page like a component and transitions them into the viewport using states.

    3. Use QDeclarativeEngine or QDeclarativeComponent to load each of the qml pages from the C++ portion of the application.

    Any thoughts would be appreciated.



  • If you want to use animation among pages one qml page will be better.



  • 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).



  • Changing the source of a Loader will cause the previously loaded source to be freed, so (1) is better than (2) in terms of memory requirements.

    Regards,
    Michael



  • hi kyleplattner.
    hey i m using loader to navigate between pages..but can u tell me how to make transition while navigating....

    regards
    imrrk


Log in to reply