Focusing away from Qt app on Mac
-
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.
-
Hi,
One starting point you can use is this stack overflow answer which uses NSWorkspace.