Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to change source
QtWS25 Last Chance

How to change source

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 955 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi.
    I'm using this row
    @this->setSource(QUrl("qrc:qml/qml/MyMobilePetTouch/QMMainForm.qml"));@
    to set the main qml screen. But How can I chage to another file?
    If I run
    @QtQuick2ApplicationViewer *Quick2ApplicationViewer= new QtQuick2ApplicationViewer(this);
    Quick2ApplicationViewer->setSource(QUrl("qrc:qml/qml/MyMobilePetTouch/QMTools.qml"));
    Quick2ApplicationViewer->showExpanded();@
    the main screen is under and I want to replace with another new one...
    How can I do to load a new qml file?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • A Offline
      A Offline
      archqt
      wrote on last edited by
      #2

      Hi,
      One way to do this is to use the visible property to hide or show an Item. Do several components ( one for each page ) and use visible to go from one screen to another. If there are too many pages, you can also load them dynamicaly.
      Sincerely

      1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by
        #3

        I have used Loader to embed in the main qml file the new files, as pages but I don't like so mutch this approach. With Declarative I can change the screen as I want.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved