コード例 #1
0
ファイル: xconsoleedit.py プロジェクト: bitesofcode/projexui
 def showMethodToolTip(self):
     """
     Pops up a tooltip message with the help for the object under the \
     cursor.
     
     :return     <bool> success
     """
     self.cancelCompletion()
     
     obj, _ = self.objectAtCursor()
     if not obj:
         return False
     
     docs = inspect.getdoc(obj)
     if not docs:
         return False
     
     # determine the cursor position
     rect   = self.cursorRect()
     cursor = self.textCursor()
     point  = QPoint(rect.left(), rect.top() + 18)
     
     QToolTip.showText(self.mapToGlobal(point), docs, self)
     
     return True
コード例 #2
0
ファイル: xconsoleedit.py プロジェクト: zengjunfeng/projexui
    def showMethodToolTip(self):
        """
        Pops up a tooltip message with the help for the object under the \
        cursor.
        
        :return     <bool> success
        """
        self.cancelCompletion()

        obj, _ = self.objectAtCursor()
        if not obj:
            return False

        docs = inspect.getdoc(obj)
        if not docs:
            return False

        # determine the cursor position
        rect = self.cursorRect()
        cursor = self.textCursor()
        point = QPoint(rect.left(), rect.top() + 18)

        QToolTip.showText(self.mapToGlobal(point), docs, self)

        return True
コード例 #3
0
ファイル: xnodehotspot.py プロジェクト: bitesofcode/projexui
 def hoverEnterEvent(self, event):
     """
     Processes when this hotspot is entered.
     
     :param      event | <QHoverEvent>
     
     :return     <bool> | processed
     """
     self._hovered = True
     if self.toolTip():
         QToolTip.showText(QCursor.pos(), self.toolTip())
         return True
     
     return self.style() == XNodeHotspot.Style.Icon
コード例 #4
0
ファイル: xnodehotspot.py プロジェクト: zengjunfeng/projexui
    def hoverEnterEvent(self, event):
        """
        Processes when this hotspot is entered.
        
        :param      event | <QHoverEvent>
        
        :return     <bool> | processed
        """
        self._hovered = True
        if self.toolTip():
            QToolTip.showText(QCursor.pos(), self.toolTip())
            return True

        return self.style() == XNodeHotspot.Style.Icon
コード例 #5
0
ファイル: xmenu.py プロジェクト: bitesofcode/projexui
 def showActionToolTip(self):
     """
     Shows the tool tip of the action that is currently being hovered over.
     
     :param      action | <QAction>
     """
     if ( not self.isVisible() ):
         return
         
     geom  = self.actionGeometry(self._toolTipAction)
     pos   = self.mapToGlobal(QPoint(geom.left(), geom.top()))
     pos.setY(pos.y() + geom.height())
     
     tip   = nativestring(self._toolTipAction.toolTip()).strip().strip('.')
     text  = nativestring(self._toolTipAction.text()).strip().strip('.')
     
     # don't waste time showing the user what they already see
     if ( tip == text ):
         return
     
     QToolTip.showText(pos, self._toolTipAction.toolTip())
コード例 #6
0
ファイル: xmenu.py プロジェクト: zengjunfeng/projexui
    def showActionToolTip(self):
        """
        Shows the tool tip of the action that is currently being hovered over.
        
        :param      action | <QAction>
        """
        if (not self.isVisible()):
            return

        geom = self.actionGeometry(self._toolTipAction)
        pos = self.mapToGlobal(QPoint(geom.left(), geom.top()))
        pos.setY(pos.y() + geom.height())

        tip = nativestring(self._toolTipAction.toolTip()).strip().strip('.')
        text = nativestring(self._toolTipAction.text()).strip().strip('.')

        # don't waste time showing the user what they already see
        if (tip == text):
            return

        QToolTip.showText(pos, self._toolTipAction.toolTip())