def __on_help_request(self): """ Help shortcut was pressed. We send a `QWhatsThisClickedEvent` and hope someone responds to it. """ # Sender is the QShortcut, and parent the OWBaseWidget widget = self.sender().parent() node = self.node_for_widget.get(widget) if node: url = "help://search?id={0}".format(node.description.id) event = QWhatsThisClickedEvent(url) QCoreApplication.sendEvent(self, event)
def __on_help_request(self): """ Help shortcut was pressed. We send a `QWhatsThisClickedEvent` to the scheme and hope someone responds to it. """ # Sender is the QShortcut, and parent the OWBaseWidget widget = self.sender().parent() try: node = self.node_for_widget(widget) except KeyError: pass else: qualified_name = node.description.qualified_name help_url = "help://search?" + urlencode({"id": qualified_name}) event = QWhatsThisClickedEvent(help_url) QCoreApplication.sendEvent(self.scheme(), event)
def __init__(self, href, url): QWhatsThisClickedEvent.__init__(self, href) self.__url = QUrl(url)