How to get childwidget to appear below parent widget?
Hey guys,
I created a parent widget using the mainwindow class and I have a separate widget which I would like to use as a "child widget". When I call the function "show()" on the childwidget, it always appears above the parent widget, is there anyway to have it appear below the parent widget? Thank you.
I've tried to "lower()" the childwidget, but it just makes both windows "disappear", and it doesn't solve the problem. "raise()" on the parent widget doesn't seem to work either.
From my understanding "stackunder()" only works on siblig widgets, not parent -child widgets.
Regards,
Pembar
Re: How to get childwidget to appear below parent widget?
"child widget"? I don't understand.
- if you want a separate window use QDialog (modular or non modular)
- if you want to layout different widgets, buttons etc. inside a main window use QLayout (QHBoxLayout...)
Re: How to get childwidget to appear below parent widget?
"child widget" was declared as a separate window - QDialog.
When I get the QDialog to "show()", it appears on top of the mainwindow, I want it to appear below.
Thanks
Re: How to get childwidget to appear below parent widget?
then use the move() function to move the dialog accorrding to the parents::pos()...
Re: How to get childwidget to appear below parent widget?
I can move it around, no problem. But it seems to always overlap the parent window. I'd like the parent window (mainwindow) to always appear above the child window (QDialog).
Re: How to get childwidget to appear below parent widget?
Quote:
Originally Posted by
Pembar
I can move it around, no problem. But it seems to always overlap the parent window. I'd like the parent window (mainwindow) to always appear above the child window (QDialog).
Ah, ok, now I get you. Sorry took a time. If the dialog is not modular a parent::setFocus() should do the trick.
Re: How to get childwidget to appear below parent widget?
Quote:
Originally Posted by
Lykurg
Ah, ok, now I get you. Sorry took a time. If the dialog is not modular a parent::setFocus() should do the trick.
EDIT: No it doesn't...
EDIT 2: ...and this wasn't the edit button:o
EDIT 3: Answer to your question: it is not possible
Re: How to get childwidget to appear below parent widget?
A child window (dialog) is always above its parent. If you want another stack order, don't pass a parent to the dialog (of course then you won't be able to make the dialog modal to the other window).