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. Focusing away from Qt app on Mac
Forum Updated to NodeBB v4.3 + New Features

Focusing away from Qt app on Mac

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 187 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.
  • NihilishN Offline
    NihilishN Offline
    Nihilish
    wrote on last edited by Nihilish
    #1

    Hi,

    I'm implementing a sort of 'show/hide' feature for a Qt Desktop app and for it to work as we intend, the window should disappear and any window the user may have beneath the Qt app should be focused instead.

    I've been using the lower() method on the main window and it mostly works, but I'm seeing in the app bar that my app still has focus. I'd like to give the focus to whatever is on top of the window stack after the main window has been lowered. In other words, I'd like to 'raise' a window that's not part of the program.

    Is this possible in any way, either via system calls or Qt screen properties?

    EDIT: If that's impossible, next best thing would be simply focusing away from the Qt app, regardless of what app (Finder for instance) the focus switches to.

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

      Hi,

      One starting point you can use is this stack overflow answer which uses NSWorkspace.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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