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 close a QML application from another QML Application?
Forum Updated to NodeBB v4.3 + New Features

How to close a QML application from another QML Application?

Scheduled Pinned Locked Moved QML and Qt Quick
12 Posts 6 Posters 7.0k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    A350XWB
    wrote on last edited by
    #1

    Hello All,
    I have written a qml application (a base screen with a list view) and am calling another qml application (another .qml file) from the base screen. But I could not find out how to close the called application only. When I use the Qt.quit(), it quits the whole application. Is there a way to close only the called application?

    1 Reply Last reply
    0
    • W Offline
      W Offline
      wladek
      wrote on last edited by
      #2

      Hi,

      What do you mean by "am calling another qml application"? Are you using a Loader element?
      Anyway, when you want to close it, you can try to hide it (set visible to false).

      Regards,
      wladek

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        Yep, .qml file is not an application. Application is your binary file, which runs these qmls (or QmlViewer if you run them from it). And Qt.quit() closes apllication itself (with all qmls loaded).

        1 Reply Last reply
        0
        • A Offline
          A Offline
          A350XWB
          wrote on last edited by
          #4

          [quote author="wladek" date="1303799170"]Hi, What do you mean by "am calling another qml application"? Are you using a Loader element? Anyway, when you want to close it, you can try to hide it (set visible to false). Regards, wladek[/quote]
          Hello, thanks for the reply. Yes, I'm using the Loader element. Hiding is an option, but what I would like to do is close the loaded qml.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DenisKormalev
            wrote on last edited by
            #5

            What do you mean by closing qml? Unloading it, hiding it, whatever else?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              A350XWB
              wrote on last edited by
              #6

              [quote author="Denis Kormalev" date="1303802222"]What do you mean by closing qml? Unloading it, hiding it, whatever else?[/quote]
              I mean, how can I unload it?

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DenisKormalev
                wrote on last edited by
                #7

                For what do you need it? When you end using object it will be disposed at some time with gc.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mlong
                  wrote on last edited by
                  #8

                  From the "Loader docs":http://doc.trolltech.com/4.7-snapshot/qml-loader.html#source-prop ...

                  bq. To unload the currently loaded item, set [source] to an empty string, or set sourceComponent to undefined.

                  Software Engineer
                  My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    A350XWB
                    wrote on last edited by
                    #9

                    Thanks for all the replies. The set[source] to empty string works for me. I missed it in the documentation.

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      eirnanG
                      wrote on last edited by
                      #10

                      [quote author="A350XWB" date="1307597557"]Thanks for all the replies. The set[source] to empty string works for me. I missed it in the documentation.[/quote]

                      i cant understand what this is.
                      but i do have the same problem.. help please. :)

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        loladiro
                        wrote on last edited by
                        #11

                        You should have clicked the link posted by @mlong in which is says:
                        [quote]
                        To unload the currently loaded item, set this property to an empty string, or set sourceComponent to undefined. Setting source to a new URL will also cause the item created by the previous URL to be unloaded.
                        [/quote]

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          eirnanG
                          wrote on last edited by
                          #12

                          THANKS! :)
                          i made it..

                          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