def event(self, ev): if ev.type() == QEvent.ToolTip: if self._showToolTips: c = self.charcodeAt(ev.pos()) if c: text = self.getToolTipText(c) if text: rect = self.charcodeRect(c) QToolTip.showText(ev.globalPos(), text, self, rect) ev.accept() return True elif ev.type() == QEvent.QueryWhatsThis: if self._showWhatsThis: ev.accept() return True elif ev.type() == QEvent.WhatsThis: ev.accept() if self._showWhatsThis: c = self.charcodeAt(ev.pos()) text = self.getWhatsThisText(c) if c else None if text: QWhatsThis.showText(ev.globalPos(), text, self) else: QWhatsThis.leaveWhatsThisMode() return True return super(CharMap, self).event(ev)
def event(self, event): """ Overridden to show shortcuts on `?` button of dialog. """ if event.type() == QEvent.EnterWhatsThisMode: from PyQt5.QtWidgets import QWhatsThis QWhatsThis.leaveWhatsThisMode() self.widget.onHelp() return True return QDialog.event(self, event)
def event(self, event): if event.type() == QEvent.EnterWhatsThisMode: QWhatsThis.leaveWhatsThisMode() QDesktopServices.openUrl(QUrl("https://github.com/ReaJason")) return QDialog.event(self, event)