16 |
16 |
17 class HelpTopicDialog(QDialog, Ui_HelpTopicDialog): |
17 class HelpTopicDialog(QDialog, Ui_HelpTopicDialog): |
18 """ |
18 """ |
19 Class implementing a dialog to select a help topic to display. |
19 Class implementing a dialog to select a help topic to display. |
20 """ |
20 """ |
21 def __init__(self, parent, keyword, documents): |
21 def __init__(self, parent, helpKeyword, documents): |
22 """ |
22 """ |
23 Constructor |
23 Constructor |
24 |
24 |
25 @param parent reference to the parent widget |
25 @param parent reference to the parent widget |
26 @type QWidget |
26 @type QWidget |
27 @param keyword keyword for the link set |
27 @param helpKeyword keyword for the link set |
28 @type str |
28 @type str |
29 @param documents list of help document link data structures |
29 @param documents list of help document link data structures |
30 @type list of QHelpLink |
30 @type list of QHelpLink |
31 """ |
31 """ |
32 super().__init__(parent) |
32 super().__init__(parent) |
33 self.setupUi(self) |
33 self.setupUi(self) |
34 |
34 |
35 self.label.setText(self.tr("Choose a &topic for <b>{0}</b>:") |
35 self.label.setText(self.tr("Choose a &topic for <b>{0}</b>:") |
36 .format(keyword)) |
36 .format(helpKeyword)) |
37 |
37 |
38 for document in documents: |
38 for document in documents: |
39 itm = self.topicsList.addItem(document.title) |
39 itm = self.topicsList.addItem(document.title) |
40 itm.setData(Qt.ItemDataRole.UserRole, document.url) |
40 itm.setData(Qt.ItemDataRole.UserRole, document.url) |
41 if self.topicsList.count() > 0: |
41 if self.topicsList.count() > 0: |