[Marble-bugs] [marble] [Bug 327655] Marble application will not exit when a plugin configuration dialog is open

Dennis Nienhüser earthwings at gentoo.org
Mon Nov 3 02:42:48 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=327655

Dennis Nienhüser <earthwings at gentoo.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |earthwings at gentoo.org
           Assignee|marble-bugs at kde.org         |mihir9293 at gmail.com
             Status|UNCONFIRMED                 |CONFIRMED

--- Comment #2 from Dennis Nienhüser <earthwings at gentoo.org> ---
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 )

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Marble-bugs mailing list