mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Fixed dialog modality
This commit is contained in:
parent
b08fc0a044
commit
b1f321d637
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user