To reproduce: 1/ open the Marble Configuration dialog 2/ go to the plugin tab and open any plugin configuration dialog 3/ don't close any dialogs and exit from Marble When exiting, the main window will close but the plugin configuration dialog will remain open and will prevent the process form terminating. Reproducible: Always
Any codepointer for this bug?
The reason for this behavior is that the config dialog is created without any parent QWidget* set. A possible fix is this one: diff --git a/src/lib/marble/MarblePluginSettingsWidget.cpp b/src/lib/marble/MarblePluginSettingsWidget.cpp index 00576e9..ad592aa 100644 --- a/src/lib/marble/MarblePluginSettingsWidget.cpp +++ b/src/lib/marble/MarblePluginSettingsWidget.cpp @@ -75,6 +75,9 @@ void MarblePluginSettingsWidgetPrivate::showPluginConfigDialog( const QModelInde DialogConfigurationInterface *configInterface = m_pluginModel->pluginDialogConfigurationInterface( index );; QDialog *configDialog = configInterface ? configInterface->configDialog() : 0; if ( configDialog ) { + Qt::WindowFlags const flags = configDialog->windowFlags(); + configDialog->setParent( q ); + configDialog->setWindowFlags( flags ); configDialog->show(); } } Here the parent is set before it is shown. Because QDialog clears its window flags on setParent() calls the original window flags are restored afterwards. Otherwise it would lose its dialog state and be embedded into the parent dialog. This patch is slightly ugly however, so I'd rather have a cleaner approach. Do you want to look into that? To do so: - Open DialogConfigurationInterface.h and add parameters QWidget * parent = 0, Qt::WindowFlags f = 0 to its virtual QDialog *configDialog() = 0; method - Change org.kde.Marble.DialogConfigurationInterface/1.0 to org.kde.Marble.DialogConfigurationInterface/1.1 in the same file - Change all plugins which implement this method to use those parameters and pass it to the QDialog they create - In MarblePluginSettingsWidget.cpp, change the configInterface->configDialog() call to configInterface->configDialog( q )
An alternative approach is to call http://qt-project.org/doc/qt-4.8/qapplication.html#closeAllWindows when exiting. It is not a perfect solution but it prevents similar issues to creep back in. This is the solution we adopted in our application.
This problem does not persist in Marble version 1.9.20 (1.10 Alpha). The main window is closed along with all the dialogs, when exiting. However, a similar problem exists. The plugin config dialogs remain open even when the Marble configuration dialog is closed. I would modify the bug statement as: When exiting Marble Configuration dialog, the Plugin Configuration dialogs does not get closed. Reproducible: Always Steps to reproduce: - open settings->"Configure Marble" - in Plugin tab, open the Configure Plugin Dialog - close the Marble Configuration Dialog.
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.