src/eric7/EricWidgets/EricTextInputDialog.py

branch
eric7
changeset 11035
e1e1d6e317c7
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
--- a/src/eric7/EricWidgets/EricTextInputDialog.py	Sun Nov 03 17:50:34 2024 +0100
+++ b/src/eric7/EricWidgets/EricTextInputDialog.py	Sun Nov 03 18:12:28 2024 +0100
@@ -7,6 +7,7 @@
 Module implementing a dialog to enter some text.
 """
 
+from PyQt6.QtCore import QCoreApplication
 from PyQt6.QtWidgets import QDialog, QDialogButtonBox, QLabel, QLineEdit, QVBoxLayout
 
 
@@ -128,6 +129,9 @@
         entered text
     @rtype tuple of (bool, str)
     """
+    if parent is None:
+        parent = QCoreApplication.instance().getMainWindow()
+
     dlg = EricTextInputDialog(parent)
     dlg.setWindowTitle(title)
     dlg.setLabelText(label)

eric ide

mercurial