MerginMaps / MerginMaps/qgis-plugin

Directory picker dialog broken

Open
#931 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
44
Forks
20
Avg merge
3d 12h
Merged PRs (30d)
5

Description

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the directory-picker calls in Mergin/create_project_wizard.py, Mergin/project_settings_widget.py, Mergin/projects_manager.py, and Mergin/utils.py. Reproduce the workflow on the reported KDE/Qt5 setup and compare behavior with the temporary DontUseNativeDialog change. Done means the affected project creation, download, and configuration flows consistently open a directory-selection dialog.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.