Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Keep my app running...
QtWS25 Last Chance

[Solved] Keep my app running...

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.9k 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.
  • D Offline
    D Offline
    Davita
    wrote on last edited by
    #1

    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
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      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
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        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
        0
        • D Offline
          D Offline
          Davita
          wrote on last edited by
          #4

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

          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