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. Raise Application after key event
Forum Updated to NodeBB v4.3 + New Features

Raise Application after key event

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

    How to send qt window(gui) application in background and raise after pressing any keys.

    please share views.

    thanks in advance...

    [[Merged similar threads into one, Tobias]]

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qtdev
      wrote on last edited by
      #2

      I hide the MainWindow by hide() function but i want to raise that window after pressing any key. is there any method how its is possible please share the code if you know and views...

      Thanks in advance..

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

        Who will receive the key event? If you hide your app, who gets the input focus?

        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
          AcerExtensa
          wrote on last edited by
          #4

          On windows you can use WINAPI to register system wide key with RegisterHotKey, no idea if you can do that for AnyKey...

          God is Real unless explicitly declared as Integer.

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

            You can create a windows wide system hook, but they also have disadvantages. And raising an app works but it will not get the input focus, if it does not have it already. No app is allowed to pull the focus, only pushing is allowed.

            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
            • C Offline
              C Offline
              CreMindES
              wrote on last edited by
              #6

              There must be some way, as uTorrent has that feature for example (boss key, if it was previously in focus), but I do not know of any such feature in Qt.

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

                I tried that once in windows, and the win32 API says, it's not possible. I don't know which bad tricks enable that ...

                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

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved