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. Main application window and a dialog interaction
Forum Updated to NodeBB v4.3 + New Features

Main application window and a dialog interaction

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 5.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
    AlekseyK
    wrote on last edited by
    #1

    Good day!

    Have a problem: main window (MyApp for example) works in background (behind all other windows or in tray), not necessary to show it without need. After some period of time some reminding StayOnTop dialog appears (having parent = 0, to be not tied to main window) and asks for some user interactions. After dialog closes I'd like to keep an application window user currently working with active, and user continue do his job not switching to MyApp. However, instead of above behaviour, main MyApp window appears and user forces to switch back to his window (job) - inconvenient.

    How to prevent MyApp main window appearing after closing the dialog? Need to install some event filter or access OS API? Problem exists in Mac, Windows, Linux.

    1 Reply Last reply
    0
    • jensen82J Offline
      jensen82J Offline
      jensen82
      wrote on last edited by
      #2

      What do you mean with "main window works in background"? Is it hidden? If i understood it right, if you close the StayOnTop-Window, your mainwindow appears, right? And that is what you don't want? What about hiding it again or just work without a mainwindow like a service/daemon in background?

      Sorry, i did not really understand...

      1 Reply Last reply
      0
      • A Offline
        A Offline
        AlekseyK
        wrote on last edited by
        #3

        I mean that it could be behind other windows (inactive) or minimized, for example. Yes, You understand right: if I close the StayOnTop-Window, mine mainwindow appears, I don't want that.

        I just do not understand why after dialog finished Qt raises main Window??? Hiding may be not correct in some cases if user works with MyApp, for example. After dialog finishing user have to have same application windows active as he had before dialog rising.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          [quote author="AlekseyK" date="1312545181"]I mean that it could be behind other windows (inactive) or minimized, for example. Yes, You understand right: if I close the StayOnTop-Window, mine mainwindow appears, I don't want that.

          I just do not understand why after dialog finished Qt raises main Window??? Hiding may be not correct in some cases if user works with MyApp, for example. After dialog finishing user have to have same application windows active as he had before dialog rising.[/quote]

          That's done by the OS. If you close a top level window inside your process that has the input focus, the input focus is moved to another window inside your process if there are some visible ones. That includes raising them.

          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
          • A Offline
            A Offline
            AlekseyK
            wrote on last edited by
            #5

            Any way to change this? OS API only?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              AFAIK not, or not on Windows. Windows does some things, you can't change. perhaps you can set your main window disabled to cheat, but I'm not sure if that works...

              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
              • A Offline
                A Offline
                AlekseyK
                wrote on last edited by
                #7

                Hmm... why Window Flags Qt example does not have that problem in that case? However not in Mac, need to check other OSs.

                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