Solved How to raise a non-modal window over a QDialog?
-
I have a
QMainWindow
which is the main application window, and would like to show anotherQMainWindow
, which is a help browser, when the user presses the F1 key. It is created with the application window as its parent object. This works nicely, and it is shown on top of the stack if only the main window or another QWidget-type window was open.But if I have opened a
QDialog
from the main window (using theexec()
function) and then press F1, the help window opens, but it is hidden by theQDialog
. Callingraise()
on the help window has no effect; and if I try to use anything but theexec()
function to open the dialog (i.e.open()
orshow()
), the dialog is not shown at all.How can I raise the help browser above the dialogs in my application, keeping it non-modal so that the user can switch between viewing the dialog and the help topics? I am using Linux Ubuntu with the default GNOME window manager, but this should eventually run on Windows as well. Thanks!
-
Solved ... the reason I didn't see anything when calling the dialog's
open()
orshow()
functions was because I was creating it as a normal variable on the stack instead of withnew
. Now everything seems to work. -
BTW, I marked this as SOLVED, got the SUCCESS notification from the web page, but the status hasn't changed yet AFAICT.
-
Hi,
Still the caching issue, it's marked properly. I see it as such.