Fixed dialog modality

This commit is contained in:
Emil Sawicki 2022-03-14 15:35:52 +01:00
parent b08fc0a044
commit b1f321d637

View File

@ -1304,21 +1304,22 @@ void BaseDesignIntf::showDialog(QWidget *widget)
return;
}
widget->setStyleSheet(findRootWidget(scene()->views().at(0))->styleSheet());
QDialog dialog;
widget->setParent(&dialog);
QDialog *dialog = new QDialog(QApplication::activeWindow());
widget->setParent(dialog);
widget->setAttribute(Qt::WA_DeleteOnClose);
#ifdef Q_OS_MAC
dialog.setWindowModality(Qt::WindowModal);
dialog->setWindowModality(Qt::WindowModal);
#else
dialog.setWindowModality(Qt::ApplicationModal);
dialog->setWindowModality(Qt::ApplicationModal);
#endif
dialog.setLayout(new QVBoxLayout());
dialog.resize(widget->size());
dialog.layout()->setContentsMargins(2,2,2,2);
dialog.layout()->addWidget(widget);
connect(widget,SIGNAL(destroyed()),&dialog,SLOT(close()));
dialog.setWindowTitle(widget->windowTitle());
dialog.exec();
dialog->setLayout(new QVBoxLayout());
dialog->resize(widget->size());
dialog->layout()->setContentsMargins(2,2,2,2);
dialog->layout()->addWidget(widget);
connect(widget,SIGNAL(destroyed()),dialog,SLOT(close()));
dialog->setWindowTitle(widget->windowTitle());
dialog->exec();
dialog->deleteLater();
}
void BaseDesignIntf::showEditorDialog()