Re: [Interest] Qt Widgets on Windows: set parent window, but NOT on top?

2020-11-24 Thread Sérgio Martins via Interest

On 2020-11-24 00:44, David M. Cotter wrote:

i have a main window with the menu bar

then a secondary, separate window.

since i want both windows to come to front when the user switches into
it, and i also want the key shortcuts from the menubar to function in
the second window, i set the parent of the 2nd window to the main
window. doing so fixes both problems.

however, when i do that, the 2nd window is ALWAYS on top of the main
window, which i do not want

the "always on top" flag of the 2nd window is NOT set.

how do i fix this?



The shortcut behaviour comes QWidget::parentWidget(), while the "keep on 
top" comes from QWindow::transientParent().


Since you only want the former, try setting a null transient parent: 
secondWindow->windowHandle()->setTransientParent(nullptr);


And let's hope it doesn't unset the parentWidget




Regards,
--
Sérgio Martins | sergio.mart...@kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Qt Widgets on Windows: set parent window, but NOT on top?

2020-11-23 Thread David M. Cotter
i have a main window with the menu bar

then a secondary, separate window.

since i want both windows to come to front when the user switches into it, and 
i also want the key shortcuts from the menubar to function in the second 
window, i set the parent of the 2nd window to the main window. doing so fixes 
both problems.

however, when i do that, the 2nd window is ALWAYS on top of the main window, 
which i do not want

the "always on top" flag of the 2nd window is NOT set.

how do i fix this?

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