In my Qt Application I\'m facing the following scenario:
When a specific event is raised I show a modeless QDialog
which asks the user for a confirmation.
The D
When modal dialog to be activated (about to show) you may try change parent of modeless dialog to this modal dialog. As modeless dialog will have the modal dialog as parent then there is a chance to have it on top. Still it may also depend on platform.
Of course ideally to avoid such situations
I found a working solution:
void MainWindow::TimerElapsed()
{
QWidget *pwidget=NULL;
m_qTimer.stop();
foreach(pwidget,QApplication::topLevelWidgets())
{
if ((pwidget->isWindow())&&(pwidget->isModal()))
{
m_pModeless->setParent(pwidget);
}
}
if (pwidget==NULL)
{
m_pModeless->setParent(this);
}
m_pModeless->show();
m_pModeless->activateWindow();
m_pModeless->raise();
m_pModeless->setFocus();
}