diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/WebBrowser/QtHelp/HelpTopicDialog.py --- a/src/eric7/WebBrowser/QtHelp/HelpTopicDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/WebBrowser/QtHelp/HelpTopicDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -18,10 +18,11 @@ """ Class implementing a dialog to select a help topic to display. """ + def __init__(self, parent, helpKeyword, documents): """ Constructor - + @param parent reference to the parent widget @type QWidget @param helpKeyword keyword for the link set @@ -31,31 +32,32 @@ """ super().__init__(parent) self.setupUi(self) - - self.label.setText(self.tr("Choose a &topic for <b>{0}</b>:") - .format(helpKeyword)) - + + self.label.setText( + self.tr("Choose a &topic for <b>{0}</b>:").format(helpKeyword) + ) + for document in documents: itm = QListWidgetItem(document.title, self.topicsList) itm.setData(Qt.ItemDataRole.UserRole, document.url) if self.topicsList.count() > 0: self.topicsList.setCurrentRow(0) self.topicsList.setFocus() - + self.topicsList.itemActivated.connect(self.accept) - + def document(self): """ Public method to retrieve the selected help topic. - + @return help document link for the selected help topic @rtype QHelpLink """ document = QHelpLink() - + itm = self.topicsList.currentItem() if itm is not None: document.title = itm.text() document.url = itm.data(Qt.ItemDataRole.UserRole) - + return document