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. Emit "ALT+TAB" when a pushbutton is clicked.
Qt 6.11 is out! See what's new in the release blog

Emit "ALT+TAB" when a pushbutton is clicked.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.2k Views 3 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.
  • J Offline
    J Offline
    jkprog
    wrote on last edited by
    #1

    I am trying to control two arduinos from the same computer. For that, I am making two QT gui windows. Now I want to have a pushbutton on both the guis, so that when the button is clicked, "ALT+TAB" signal is emitted and the user can then switch between the two GUI windows. Is this possible?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You would have to use the platforms native api for this I think.
      Its controlled by the OS.
      You could also make your own solution using
      QLocalServer and QLocalSocket to send "event" to get focus.

      1 Reply Last reply
      2
      • Vinod KuntojiV Offline
        Vinod KuntojiV Offline
        Vinod Kuntoji
        wrote on last edited by Vinod Kuntoji
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • A Offline
          A Offline
          ambershark
          wrote on last edited by
          #4

          It's not possible via the "alt+tab" method, however you wouldn't want to use that anyway. There would be no way to guarantee that you alt+tabbed to the proper window if the sequence was changed by the user via actual alt+tabbing at some point (or even clicking a new window).

          This is however possible using the native windowing system on all platforms. Pretty much exactly as @mrjj said.

          I haven't done it on osx but you can definitely do it with Win32 API and X11. Just google gaining focus of windows in <platform here> with c++ and you should have plenty of articles and reference material to get you through it.

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

          1 Reply Last reply
          2

          • Login

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