Skip to content

Directory picker dialog broken #931

Description

@Withalion

Recently some packages got updated in KDE and directory picker dialogs are now broken. The opened dialog expects the user to select file instead of directory. This breaks core workflows like creating new project or downloading projects already in cloud.

Software info:

  • Fedora 43 KDE
  • QGIS -> 3.44.12
  • MM plugin -> 2026.5.0
  • MM pyAPI -> 0.14.1
  • Qt -> 5.15.18
  • Dolphin -> 26.04.3

I didn't find the exact culprit. Looks like the issue stems from degraded support for Qt5 apps as I was not able to replicate this issue on demo Qt6 app. I tried to downgrade said packages to package versions equal to setup of @uclaros without any success.

Uclaros's software versions:

  • Debian testing KDE
  • QGIS -> 3.44.11
  • Qt -> 5.15.17
  • Dolphin -> 26.04.0

The patch that helped me temporary fix the issues:

diff --git a/Mergin/create_project_wizard.py b/Mergin/create_project_wizard.py
index 27f2298..a78c200 100644
--- a/Mergin/create_project_wizard.py
+++ b/Mergin/create_project_wizard.py
@@ -149,7 +149,7 @@ class ProjectSettingsPage(ui_proj_settings, base_proj_settings):
         last_dir = settings.value("Mergin/lastUsedDownloadDir", str(Path.home()))
         user_path = self.path_ledit.text()
         last_dir = user_path if user_path else last_dir
-        self.dir_path = QFileDialog.getExistingDirectory(None, "Choose project parent directory", last_dir)
+        self.dir_path = QFileDialog.getExistingDirectory(None, "Choose project parent directory", last_dir, QFileDialog.Option.ShowDirsOnly | QFileDialog.Option.DontUseNativeDialog)
         if self.dir_path:
             self.path_ledit.setText(self.dir_path)
             settings = QSettings()
diff --git a/Mergin/project_settings_widget.py b/Mergin/project_settings_widget.py
index 4f499f9..ac755a8 100644
--- a/Mergin/project_settings_widget.py
+++ b/Mergin/project_settings_widget.py
@@ -212,7 +212,7 @@ class ProjectConfigWidget(ProjectConfigUiWidget, QgsOptionsPageWidget):
             None,
             "Select directory",
             self.local_project_dir,
-            QFileDialog.Option.ShowDirsOnly,
+            QFileDialog.Option.ShowDirsOnly | QFileDialog.Option.DontUseNativeDialog,
         )
         if self.local_project_dir not in abs_path:
             return
diff --git a/Mergin/projects_manager.py b/Mergin/projects_manager.py
index c424359..8cb3526 100644
--- a/Mergin/projects_manager.py
+++ b/Mergin/projects_manager.py
@@ -616,7 +616,7 @@ class MerginProjectsManager(object):
         settings = QSettings()
         last_parent_dir = settings.value("Mergin/lastUsedDownloadDir", str(Path.home()))
         parent_dir = QFileDialog.getExistingDirectory(
-            None, "Open Directory", last_parent_dir, QFileDialog.Option.ShowDirsOnly
+            None, "Open Directory", last_parent_dir, QFileDialog.Option.ShowDirsOnly | QFileDialog.Option.DontUseNativeDialog
         )
         if not parent_dir:
             return
diff --git a/Mergin/utils.py b/Mergin/utils.py
index ed0ffe0..e4e3ad8 100644
--- a/Mergin/utils.py
+++ b/Mergin/utils.py
@@ -367,7 +367,7 @@ def get_new_qgis_project_filepath(project_name=None):
     last_dir = settings.value("Mergin/lastUsedDownloadDir", str(pathlib.Path.home()))
     if project_name is not None:
         dest_dir = QFileDialog.getExistingDirectory(
-            None, "Destination directory", last_dir, QFileDialog.Option.ShowDirsOnly
+            None, "Destination directory", last_dir, QFileDialog.Option.ShowDirsOnly | QFileDialog.Option.DontUseNativeDialog
         )
         project_file = os.path.abspath(os.path.join(dest_dir, project_name))
     else:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions