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
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
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())
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())