[Interest] Modeless dialog issue on Mac

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Tue Nov 14 13:09:22 CET 2023


The broken button rendering is a bug, please file one in JIRA, thanks :)

On 14 Nov 2023, at 11:49, Calogero Mauceri <mauceri at actgate.com> wrote:

Hi all,

I have the following problem with dialogs on the Mac.

I have a main window/dialog and I am opening a modeless dialog, I need to have both the main window/dialog and the modeless dialog visible at the same time.
I create the modeless dialog as simple as this

QDialog* myDialog = new QDialog(this);
[...]
myDialog->show();
myDialog->raise();
myDialog->activateWindow();

The problem I'm having is that if I click on the main window then the dialog disappears behind the main application window.
The workaround I've found is to create the dialog as a tool dialog. In that case the dialog stays always on top of the main application window, but there are some issues with the modeless dialog default button rendering when the dialog loses focus as visible in the following image where the default button in the first one.

<tool_dialog.png>

I created a very sample application that opens both a "standard" dialog and a tool dialog, here are both issues in a screenshot

<Screenshot 2023-11-14 alle 11.30.56.png>


The standard dialog is behind the main application, while the tool dialog default button is not properly rendered when the tool dialog loses focus.

Is there any workaround? Is this a Qt bug?
Attached is the code for the above example.
The example works fine on windows, with both types of dialogs.

--
Calogero Mauceri
Software Engineer

Applied Coherent Technology Corporation (ACT)
www.actgate.com<http://www.actgate.com/>
<dialog_test.h><dialog_test.pro><dialog_test.cpp><main.cpp>_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20231114/0d67f51e/attachment.htm>


More information about the Interest mailing list