[Interest] Modeless dialog issue on Mac

Oliver Knoll till.oliver.knoll at gmail.com
Tue Nov 14 18:55:57 CET 2023



> Am 14.11.2023 um 16:29 schrieb Calogero Mauceri <mauceri at 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


More information about the Interest mailing list