5 |
5 |
6 """ |
6 """ |
7 Module implementing a dialog to select a color by name. |
7 Module implementing a dialog to select a color by name. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt5.QtGui import QColor, QPixmap, QIcon |
10 from PyQt6.QtGui import QColor, QPixmap, QIcon |
11 from PyQt5.QtWidgets import QDialog |
11 from PyQt6.QtWidgets import QDialog |
12 |
12 |
13 from .Ui_ColorSelectionDialog import Ui_ColorSelectionDialog |
13 from .Ui_ColorSelectionDialog import Ui_ColorSelectionDialog |
14 |
14 |
15 |
15 |
16 class ColorSelectionDialog(QDialog, Ui_ColorSelectionDialog): |
16 class ColorSelectionDialog(QDialog, Ui_ColorSelectionDialog): |
20 def __init__(self, selectedName="", parent=None): |
20 def __init__(self, selectedName="", parent=None): |
21 """ |
21 """ |
22 Constructor |
22 Constructor |
23 |
23 |
24 @param selectedName name of the color to be selected initially |
24 @param selectedName name of the color to be selected initially |
25 (string) |
25 @type str |
26 @param parent reference to the parent widget (QWidget) |
26 @param parent reference to the parent widget |
|
27 @type QWidget |
27 """ |
28 """ |
28 super().__init__(parent) |
29 super().__init__(parent) |
29 self.setupUi(self) |
30 self.setupUi(self) |
30 |
31 |
31 for colorName in QColor.colorNames(): |
32 for colorName in QColor.colorNames(): |