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. calling another qml file from main qml file
Forum Update on Monday, May 27th 2025

calling another qml file from main qml file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlqt quickcall
6 Posts 2 Posters 2.8k 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.
  • QjayQ Offline
    QjayQ Offline
    Qjay
    wrote on last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • L Offline
      L Offline
      literA2
      wrote on last edited by
      #2

      @Qjay have you tried using Loader? You can set it's source to view or load another qml file and set it to blank ("") to unload it.

      QjayQ 1 Reply Last reply
      0
      • L literA2

        @Qjay have you tried using Loader? You can set it's source to view or load another qml file and set it to blank ("") to unload it.

        QjayQ Offline
        QjayQ Offline
        Qjay
        wrote on last edited by
        #3

        @literA2 Thanks it worked ( earlier i did tried Loader but i was doing it wrong )

        here is how it worked :

         Loader{
                    id : webview
                }
        
                onClicked: {
                    onClicked: webview.source = "Mywebview.qml"
        
                }
            }
        
        1 Reply Last reply
        0
        • QjayQ Offline
          QjayQ Offline
          Qjay
          wrote on last edited by
          #4

          Is it possible to keep on calling that qml file . Currently when i click on show page it only shows it once . If i close it , it does not show that webview again

          L 1 Reply Last reply
          0
          • QjayQ Qjay

            Is it possible to keep on calling that qml file . Currently when i click on show page it only shows it once . If i close it , it does not show that webview again

            L Offline
            L Offline
            literA2
            wrote on last edited by
            #5

            @Qjay yes, have you tried clearing it's source or setting it to blank once you closed the webview?

            1 Reply Last reply
            0
            • QjayQ Offline
              QjayQ Offline
              Qjay
              wrote on last edited by
              #6

              yes , i have tried it but if i set it to blank suddenly the webview closes . I am not sure where should i place that code .

              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