PDA

View Full Version : Widget over modal dialog



mpi
15th May 2012, 20:13
Hi,

Here's my problem:

* Launch a modal dialog where some input parameters to the main app. can be set.
* Modal dialog contains a 'plot' button that launches a widget displaying a 2D plot visualizing some consequences of the parameter settings.
* When the plot window is shown, the window is always underneath the modal dialog.

Is it possible to make the plot appear on top of the main modal dialog, provided its the active window? That is, relative to the main dialog is should behave like a completely normal window.

To me it makes sense to do something like this, but correct me if I'm wrong.

BTW: The main dialog from where the 2D plot is launched, takes care of closing the 2D plot if its open.

Best regards,

Mads

d_stranz
16th May 2012, 04:43
If the modal dialog and the plot widget are both siblings (that is, children of the same parent, for example, the main dialog), then you should be able to call plot->raise() after you show the plot window. See QWidget::raise(). Alternatively, you could call QWidget::stackUnder() using the plot as the QWidget to be on top.

Santosh Reddy
16th May 2012, 06:23
Make Modal Dialog parent of Widget (which has the plot), while creating the Widget

mpi
16th May 2012, 14:10
If the modal dialog and the plot widget are both siblings (that is, children of the same parent, for example, the main dialog), then you should be able to call plot->raise() after you show the plot window. See QWidget::raise(). Alternatively, you could call QWidget::stackUnder() using the plot as the QWidget to be on top.

Thanks, will try it.