--- a/eric7/WebBrowser/QtHelp/HelpIndexWidget.py Tue Aug 31 19:56:40 2021 +0200 +++ b/eric7/WebBrowser/QtHelp/HelpIndexWidget.py Wed Sep 01 18:11:31 2021 +0200 @@ -101,39 +101,39 @@ else: self.openUrl.emit(document.url) - def __documentsActivated(self, documents, keyword): + def __documentsActivated(self, documents, helpKeyword): """ Private slot to handle the activation of an entry with multiple help documents. @param documents list of help document link data structures @type list of QHelpLink - @param keyword keyword for the entry + @param helpKeyword keyword for the entry @type str """ modifiers = QApplication.keyboardModifiers() document = ( documents[0] if len(documents) == 1 else - self.__selectDocument(documents, keyword) + self.__selectDocument(documents, helpKeyword) ) - self.__documentActivated(document, keyword, modifiers) + self.__documentActivated(document, helpKeyword, modifiers) - def __selectDocument(self, documents, keyword): + def __selectDocument(self, documents, helpKeyword): """ Private method to give the user a chance to select among the given documents. @param documents list of help document link data structures @type list of QHelpLink - @param keyword keyword for the documents + @param helpKeyword keyword for the documents @type str @return selected document @rtype QHelpLink """ document = QHelpLink() from .HelpTopicDialog import HelpTopicDialog - dlg = HelpTopicDialog(self, keyword, documents) + dlg = HelpTopicDialog(self, helpKeyword, documents) if dlg.exec() == QDialog.DialogCode.Accepted: document = dlg.document() return document @@ -225,12 +225,12 @@ act = menu.exec() model = self.__index.model() if model is not None: - keyword = model.data(idx, Qt.ItemDataRole.DisplayRole) - links = model.linksForKeyword(keyword) - if len(links) == 1: - link = QUrl(links[list(links.keys())[0]]) + helpKeyword = model.data(idx, Qt.ItemDataRole.DisplayRole) + helpLinks = self.__engine.documentsForKeyword(helpKeyword, "") + if len(helpLinks) == 1: + link = helpLinks[0].url else: - link = self.__selectLink(links, keyword) + link = self.__selectDocument(helpLinks, helpKeyword) if not link.isEmpty() and link.isValid(): if act == curTab: