A non-modal Dialog (NSPanel) isn’t inherently at a higher window level than a 
normal window on macOS:

<https://developer.apple.com/documentation/appkit/nswindowlevel?language=objc>
[developer-og.jpg]
NSWindowLevel | Apple Developer 
Documentation<https://developer.apple.com/documentation/appkit/nswindowlevel?language=objc>
developer.apple.com<https://developer.apple.com/documentation/appkit/nswindowlevel?language=objc>

We could potentially work around it by using a non-standard window level, but 
it might have unforeseen consequences.

I recommend using the Qt::WindowStaysOnTopHint as a workaround.

Tor Arne


On 14 Nov 2023, at 18:55, Oliver Knoll <till.oliver.kn...@gmail.com> wrote:



Am 14.11.2023 um 16:29 schrieb Calogero Mauceri <mauc...@actgate.com>:


Here "this" is a pointer to the parent dialog. I've tried with QMainWindow too 
as a parent, but unfortunately the problem is still there, not sure if that's 
another bug.
The only way I found for having the modeless dialog on top of its parent is to 
create it with Qt::Tool flag.

You don‘t need to create a „tool window“: any QWidget (QWindow?) based window 
should do.

From the top of my head there should exist an „always on top“ window flag. Pass 
this to the constructor of your QDialog, refer to the Qt docs wrt „window 
flags“ (or similar).

I definitively managed to keep a QMainWindow „always on top“ with this approach 
(Win/Mac/Linux), but I expect this to work with QDialogs, too.

Best,
 Oliver
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to