Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    [Solved] Keep my app running...

    General and Desktop
    3
    4
    1731
    Loading More Posts
    • 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.
    • D
      Davita last edited by

      Hi guys.
      I'm developing an application which should run in background, and sometimes should show different dialogs. It has a tray icon in taskbar and everything is working fine, but I have one problem I wasn't able to solve. When the first dialog is closed, the application terminates and this is not the behavior I want to have (I want the app to be running, even after the dialog closes). To solve this, I added an empty dialog in the system which is created at startup but hidden. This also didn't solve the problem. If I don't hide the empty dialog and keep it shown, the application doesn't terminate.
      I know there should be an easy solution to my problem, I just don't know where to look :)
      I just want my app to keep running after the dialogs are closed.

      Your help is much appreciated.
      Thanks

      1 Reply Last reply Reply Quote 0
      • G
        giesbert last edited by

        You should use the property "quitOnLastWindowClosed":http://doc.qt.nokia.com/latest/qapplication.html#quitOnLastWindowClosed-prop of the QApplication object. Setting this to false should do the trick.

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply Reply Quote 0
        • K
          koahnig last edited by

          Probably you are close the window with the cross button or some other means to quit the whole application. Why do you give the window a button, which simply hides the window?

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply Reply Quote 0
          • D
            Davita last edited by

            @Gerolf, thank you very much, it worked :)

            1 Reply Last reply Reply Quote 0
            • First post
              Last post