Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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.
    Thanks
    Eric



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

    @
    void CMyBackgroundWidget::focusInEvent(QEvent*)
    {
    m_pMyForegroundWidget->raise();
    }
    @

    the "raise()":http://qt-project.org/doc/qt-4.8/qwidget.html#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.


Log in to reply