5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to select one entry from a list of strings. |
7 Module implementing a dialog to select one entry from a list of strings. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtCore import pyqtSlot |
10 from PyQt6.QtCore import QCoreApplication, pyqtSlot |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
11 from PyQt6.QtWidgets import QDialog, QDialogButtonBox |
12 |
12 |
13 from .Ui_EricComboSelectionDialog import Ui_EricComboSelectionDialog |
13 from .Ui_EricComboSelectionDialog import Ui_EricComboSelectionDialog |
14 |
14 |
15 |
15 |
29 @param message message to be show in the dialog (defaults to "") |
29 @param message message to be show in the dialog (defaults to "") |
30 @type str (optional) |
30 @type str (optional) |
31 @param parent reference to the parent widget (defaults to None) |
31 @param parent reference to the parent widget (defaults to None) |
32 @type QWidget (optional) |
32 @type QWidget (optional) |
33 """ |
33 """ |
|
34 if parent is None: |
|
35 parent = QCoreApplication.instance().getMainWindow() |
|
36 |
34 super().__init__(parent) |
37 super().__init__(parent) |
35 self.setupUi(self) |
38 self.setupUi(self) |
36 |
39 |
37 for entry in entries: |
40 for entry in entries: |
38 if isinstance(entry, tuple): |
41 if isinstance(entry, tuple): |