May 15, 2012

elm66 elm66
Lab Rat
2 posts

Issues with non-modal dialog being displayed behind their parent


I have been having issues since 4.8 with non-modal dialogs that hide behind their parent when the parent is refocused.
This was not a behavior in the prior version 4.7. I am sure not to be the only one with that issue. Is this reported as a bug? Is there any solutions? even temp ones.

1 reply

May 16, 2012

rschaub rschaub
Lab Rat
33 posts

I’m unaware of this bug, but you can circumvent it by using something similar to

  1. void CMyBackgroundWidget::focusInEvent(QEvent*)
  2. {
  3.   m_pMyForegroundWidget->raise();
  4. }

the raise() [] will move the foreground widget to the top of the hierarchy and display it there.
Note that m_pMyForegroundWidget should be on the same hierarchy level as the instance of CMyBackgroundWidget. If they’re descendants of each other, this fix won’t work.

  ‹‹ /dev/input/      Icons in the QTabWidget tabs disappear when the tab is selected ››

You must log in to post a reply. Not a member yet? Register here!