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;
|
return;
|
||||||
}
|
}
|
||||||
widget->setStyleSheet(findRootWidget(scene()->views().at(0))->styleSheet());
|
widget->setStyleSheet(findRootWidget(scene()->views().at(0))->styleSheet());
|
||||||
QDialog dialog;
|
QDialog *dialog = new QDialog(QApplication::activeWindow());
|
||||||
widget->setParent(&dialog);
|
widget->setParent(dialog);
|
||||||
widget->setAttribute(Qt::WA_DeleteOnClose);
|
widget->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
dialog.setWindowModality(Qt::WindowModal);
|
dialog->setWindowModality(Qt::WindowModal);
|
||||||
#else
|
#else
|
||||||
dialog.setWindowModality(Qt::ApplicationModal);
|
dialog->setWindowModality(Qt::ApplicationModal);
|
||||||
#endif
|
#endif
|
||||||
dialog.setLayout(new QVBoxLayout());
|
dialog->setLayout(new QVBoxLayout());
|
||||||
dialog.resize(widget->size());
|
dialog->resize(widget->size());
|
||||||
dialog.layout()->setContentsMargins(2,2,2,2);
|
dialog->layout()->setContentsMargins(2,2,2,2);
|
||||||
dialog.layout()->addWidget(widget);
|
dialog->layout()->addWidget(widget);
|
||||||
connect(widget,SIGNAL(destroyed()),&dialog,SLOT(close()));
|
connect(widget,SIGNAL(destroyed()),dialog,SLOT(close()));
|
||||||
dialog.setWindowTitle(widget->windowTitle());
|
dialog->setWindowTitle(widget->windowTitle());
|
||||||
dialog.exec();
|
dialog->exec();
|
||||||
|
dialog->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseDesignIntf::showEditorDialog()
|
void BaseDesignIntf::showEditorDialog()
|
||||||
|
Loading…
Reference in New Issue
Block a user