src/eric7/EricWidgets/EricPathPickerDialog.py

branch
eric7
changeset 11035
e1e1d6e317c7
parent 10630
552a790fd9bc
child 11090
f5f5f5803935
--- a/src/eric7/EricWidgets/EricPathPickerDialog.py	Sun Nov 03 17:50:34 2024 +0100
+++ b/src/eric7/EricWidgets/EricPathPickerDialog.py	Sun Nov 03 18:12:28 2024 +0100
@@ -7,6 +7,7 @@
 Module implementing a dialog to enter a file system path using a file picker.
 """
 
+from PyQt6.QtCore import QCoreApplication
 from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QLabel, QVBoxLayout
 
 from .EricPathPicker import EricPathPicker, EricPathPickerModes
@@ -169,6 +170,9 @@
         user pressed the OK button
     @rtype tuple of (str, bool)
     """
+    if parent is None:
+        parent = QCoreApplication.instance().getMainWindow()
+
     # step 1: setup of the dialog
     dlg = EricPathPickerDialog(parent)
     if title:
@@ -227,6 +231,9 @@
         user pressed the OK button
     @rtype tuple of (pathlib.Path, bool)
     """
+    if parent is None:
+        parent = QCoreApplication.instance().getMainWindow()
+
     # step 1: setup of the dialog
     dlg = EricPathPickerDialog(parent)
     if title:

eric ide

mercurial