Merge pull request #528 from ispyisail/fix/project-props-dialog-modality

Merged as discussed in #527 
Thanks @ispyisail
This commit is contained in:
plc-user
2026-06-22 20:28:27 +02:00
committed by GitHub
2 changed files with 11 additions and 2 deletions
+4 -1
View File
@@ -1993,7 +1993,10 @@ void QETApp::configureQET()
// cree le dialogue // cree le dialogue
ConfigDialog cd; ConfigDialog cd;
cd.setWindowTitle(tr("Configurer QElectroTech", "window title")); cd.setWindowTitle(tr("Configurer QElectroTech", "window title"));
cd.setWindowModality(Qt::WindowModal); // ApplicationModal so no other window can dispatch events while the dialog
// holds raw pointers derived from the current project list. Same class of
// bug as ProjectPropertiesDialog — see issue #527.
cd.setWindowModality(Qt::ApplicationModal);
cd.addPage(new GeneralConfigurationPage()); cd.addPage(new GeneralConfigurationPage());
cd.addPage(new NewDiagramPage()); cd.addPage(new NewDiagramPage());
cd.addPage(new ExportConfigPage()); cd.addPage(new ExportConfigPage());
+7 -1
View File
@@ -63,7 +63,13 @@ ProjectPropertiesDialog::~ProjectPropertiesDialog ()
*/ */
void ProjectPropertiesDialog::exec() void ProjectPropertiesDialog::exec()
{ {
m_properties_dialog->setWindowModality(Qt::WindowModal); // ApplicationModal (not WindowModal) so no other window — including other
// MDI subwindows — can dispatch events while the dialog holds raw
// QETProject* pointers in its config pages. WindowModal only blocks the
// parent ProjectView; the rest of the MDI area stays live, which allowed
// new_project / close_project to replace the project under the dialog
// and cause a SIGSEGV. See issue #527.
m_properties_dialog->setWindowModality(Qt::ApplicationModal);
m_properties_dialog -> exec(); m_properties_dialog -> exec();
} }