From bab32b3764c3bb89c2d90cbd2e363915769b2cf7 Mon Sep 17 00:00:00 2001 From: Shane Ringrose Date: Mon, 22 Jun 2026 17:48:19 +1200 Subject: [PATCH] Fix #527 follow-up: use ApplicationModal for app config dialog (configureQET) Same root cause as ProjectPropertiesDialog: Qt::WindowModal only blocks the direct parent window, leaving the rest of the MDI area live. If new_project or close_project fires while the app settings dialog is open, any raw pointers derived from the project list become stale. Switch to ApplicationModal to block all windows for the duration of the dialog. Co-Authored-By: Claude Sonnet 4.6 --- sources/qetapp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index aaa462fc5..ef561dabd 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -1969,7 +1969,10 @@ void QETApp::configureQET() // cree le dialogue ConfigDialog cd; 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 NewDiagramPage()); cd.addPage(new ExportConfigPage());