Пример #1
0
 def event(self, event):
     if event.type() == QEvent.ToolTip:
         cursor = self.cursorForPosition(event.pos())
         cursor.select(QTextCursor.BlockUnderCursor)
         if cursor.selectedText():
             for dp, np in XmlHighlighter.DEPRECATED_PARAMETER.items():
                 if 'name="%s"' % dp in cursor.selectedText():
                     QToolTip.showText(event.globalPos(), ' %s is deprecated, use %s' % (dp, np))
         else:
             QToolTip.hideText()
         return True
     return QTextEdit.event(self, event)
Пример #2
0
 def hoverLeaveEvent(self, event):
     QToolTip.hideText()
Пример #3
0
 def hoverEnterEvent(self, event):
     QToolTip.showText(event.screenPos(), self.label)