1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2015 - 2021 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing a dialog to show some help text. |
|
8 """ |
|
9 |
|
10 from PyQt6.QtCore import Qt |
|
11 from PyQt6.QtWidgets import QDialog |
|
12 |
|
13 from .Ui_E5SimpleHelpDialog import Ui_E5SimpleHelpDialog |
|
14 |
|
15 |
|
16 class E5SimpleHelpDialog(QDialog, Ui_E5SimpleHelpDialog): |
|
17 """ |
|
18 Class implementing a dialog to show some help text. |
|
19 """ |
|
20 def __init__(self, title="", label="", helpStr="", parent=None): |
|
21 """ |
|
22 Constructor |
|
23 |
|
24 @param title title of the window |
|
25 @type str |
|
26 @param label label for the help |
|
27 @type str |
|
28 @param helpStr HTML help text |
|
29 @type str |
|
30 @param parent reference to the parent widget |
|
31 @type QWidget |
|
32 """ |
|
33 super().__init__(parent) |
|
34 self.setupUi(self) |
|
35 self.setWindowFlags(Qt.WindowType.Window) |
|
36 |
|
37 self.setWindowTitle(title) |
|
38 if label: |
|
39 self.helpLabel.setText(label) |
|
40 else: |
|
41 self.helpLabel.hide() |
|
42 self.helpEdit.setHtml(helpStr) |
|