UI: Show app modal dialogs on top of Graph Window

This commit is contained in:
Nodir Temirkhodjaev 2024-01-13 18:25:06 +03:00
parent f965b6a447
commit 8cdc72c41d

View File

@ -35,7 +35,13 @@ QColor DialogUtil::getColor(const QColor &initial, const QString &title)
void DialogUtil::setupModalDialog(QWidget *box)
{
box->setWindowModality(box->parent() ? Qt::WindowModal : Qt::ApplicationModal);
const bool isAppModal = !box->parent();
box->setWindowModality(isAppModal ? Qt::ApplicationModal : Qt::WindowModal);
if (isAppModal) {
box->setWindowFlag(Qt::WindowStaysOnTopHint);
}
}
QMessageBox *DialogUtil::createMessageBox(const MessageBoxArg &ba, QWidget *parent)