def mouseMoveEvent(self, event): """Tooltips for the marks""" if not self.__noTooltip: blockNumber = self._qpart.cursorForPosition( event.pos()).blockNumber() lineno = blockNumber + 1 msg = None if lineno == self.excptionLine: msg = 'Exception line' elif lineno == self.currentDebugLine: msg = 'Current debugger line' elif lineno in self.__messages: msg = '' for part in self.__messages[lineno]: if msg: msg += '<br/>' msg += escape(part) msg = "<p style='white-space:pre'>" + msg + "</p>" if msg: QToolTip.showText(event.globalPos(), msg) else: QToolTip.hideText() return QWidget.mouseMoveEvent(self, event)
def show(self): """Shows the tooltip at the proper position""" QToolTip.hideText() QApplication.processEvents() if self.__inside: self.move(self.__getTooltipPos()) self.raise_() QFrame.show(self)
def __showRevisionTooltip(self, position, x, y): """Shows the tooltip""" # Calculate the line pos = self.SendScintilla(self.SCI_POSITIONFROMPOINT, x, y) line, posInLine = self.lineIndexFromPosition(pos) tooltip = self.__getRevisionMarginTooltip(line) if tooltip: QToolTip.showText(self.mapToGlobal(QPoint(x, y)), tooltip) self.__revisionTooltipShown = True
def mouseMoveEvent(self, event): """Tooltips for the text""" blockNumber = self._qpart.cursorForPosition(event.pos()).blockNumber() lineno = blockNumber + 1 if lineno in self.__data: props = self.__data.get(lineno, [(None, None, None)]) tooltipItems = [] for prop in props: if prop[1]: msgType = prop[2] tooltipItems.append( CDMRedirectedIOMargin.MSG_TYPE_PROPS[msgType][0] + prop[1]) if tooltipItems: tooltip = "<p style='white-space:pre'>" + \ escape('\n'.join(tooltipItems)) + "</p>" QToolTip.showText(event.globalPos(), tooltip) else: QToolTip.hideText() return QWidget.mouseMoveEvent(self, event)
def onTagHelp(self): """Provides help for an item if available""" if not self.isPythonBuffer(): return QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) definitions = getDefinitions(self, self._parent.getFileName()) QApplication.restoreOverrideCursor() parts = [] for definition in definitions: header = 'Type: ' + definition[3] if definition[5]: header += '\nModule: ' + definition[5] parts.append(header + '\n\n' + definition[4]) if parts: QToolTip.showText(self.mapToGlobal(self.cursorRect().bottomLeft()), '<pre>' + '\n\n'.join(parts) + '</pre>') else: GlobalData().mainWindow.showStatusBarMessage( "Definition is not found")
def mouseMoveEvent(self, event): """Tooltips for the marks""" if self.__breakpoints: textCursor = self._qpart.cursorForPosition(event.pos()) block = textCursor.block() msg = None blockValue = self.getBlockValue(block) if blockValue != 0: bpoint = self.__breakpoints[blockValue] if not bpoint.isEnabled(): msg = 'Disabled breakpoint' elif bpoint.isTemporary(): msg = 'Temporary breakpoint' else: msg = 'Regular breakpoint' if msg: QToolTip.showText(event.globalPos(), msg) else: QToolTip.hideText() return QWidget.mouseMoveEvent(self, event)
def _onDwellEnd(self, position, x, y): """Triggered when mouse ended to dwell""" if self.__revisionTooltipShown: self.__revisionTooltipShown = False QToolTip.hideText()