本文整理汇总了Python中spyderlib.qt.QtGui.QToolTip类的典型用法代码示例。如果您正苦于以下问题:Python QToolTip类的具体用法?Python QToolTip怎么用?Python QToolTip使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QToolTip类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: update_warning
def update_warning(self):
""" """
widget = self._button_warning
if not self.is_valid():
tip = _('Array dimensions not valid')
widget.setIcon(ima.icon('MessageBoxWarning'))
widget.setToolTip(tip)
QToolTip.showText(self._widget.mapToGlobal(QPoint(0, 5)), tip)
else:
self._button_warning.setToolTip('')
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:10,代码来源:arraybuilder.py
示例2: hide_tooltip_if_necessary
def hide_tooltip_if_necessary(self, key):
"""Hide calltip when necessary"""
try:
calltip_char = self.get_character(self.calltip_position)
before = self.is_cursor_before(self.calltip_position, char_offset=1)
other = key in (Qt.Key_ParenRight, Qt.Key_Period, Qt.Key_Tab)
if calltip_char not in ("?", "(") or before or other:
QToolTip.hideText()
except (IndexError, TypeError):
QToolTip.hideText()
开发者ID:sys-bio,项目名称:Spyderplugin_ratelaws,代码行数:10,代码来源:base.py
示例3: keyPressEvent
def keyPressEvent(self, event):
"""Override Qt method"""
QToolTip.hideText()
ctrl = event.modifiers() & Qt.ControlModifier
if event.key() in [Qt.Key_Enter, Qt.Key_Return]:
if ctrl:
self.process_text(array=False)
else:
self.process_text(array=True)
self.accept()
else:
QDialog.keyPressEvent(self, event)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:13,代码来源:arraybuilder.py
示例4: show_calltip
def show_calltip(self, title, text, signature=False, color='#2D62FF',
at_line=None, at_position=None):
"""Show calltip"""
if text is None or len(text) == 0:
return
# Saving cursor position:
if at_position is None:
at_position = self.get_position('cursor')
self.calltip_position = at_position
# Preparing text:
if signature:
text, wrapped_textlines = self._format_signature(text)
else:
if isinstance(text, list):
text = "\n ".join(text)
text = text.replace('\n', '<br>')
if len(text) > self.calltip_size:
text = text[:self.calltip_size] + " ..."
# Formatting text
font = self.font()
size = font.pointSize()
family = font.family()
format1 = '<div style=\'font-family: "%s"; font-size: %spt; color: %s\'>'\
% (family, size, color)
format2 = '<div style=\'font-family: "%s"; font-size: %spt\'>'\
% (family, size-1 if size > 9 else size)
tiptext = format1 + ('<b>%s</b></div>' % title) + '<hr>' + \
format2 + text + "</div>"
# Showing tooltip at cursor position:
cx, cy = self.get_coordinates('cursor')
if at_line is not None:
cx = 5
cursor = QTextCursor(self.document().findBlockByNumber(at_line-1))
cy = self.cursorRect(cursor).top()
point = self.mapToGlobal(QPoint(cx, cy))
point.setX(point.x()+self.get_linenumberarea_width())
point.setY(point.y()+font.pointSize()+5)
if signature:
self.calltip_widget.show_tip(point, tiptext, wrapped_textlines)
else:
QToolTip.showText(point, tiptext)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:45,代码来源:mixins.py
示例5: update_warning
def update_warning(self, reset=False):
""" """
conflicts = self.check_conflicts()
if reset:
conflicts = []
widget = self.helper_button
if conflicts:
tip_title = _('The new entered shorcut conflicts with:') + '\n'
tip_body = ''
for s in conflicts:
tip_body += ' - {0}: {1}\n'.format(s.context, s.name)
tip = '{0}{1}'.format(tip_title, tip_body)
widget.setIcon(get_std_icon('MessageBoxWarning'))
widget.setToolTip(tip)
QToolTip.showText(widget.mapToGlobal(QPoint(0, 5)), tip)
else:
widget.setToolTip('')
QToolTip.hideText()
widget.setIcon(get_std_icon('DialogApplyButton'))
开发者ID:ptocca,项目名称:spyder,代码行数:21,代码来源:shortcuts.py
示例6: show_tip
def show_tip(self, tip=""):
"""Show tip"""
QToolTip.showText(self.mapToGlobal(self.pos()), tip, self)
开发者ID:gyenney,项目名称:Tools,代码行数:3,代码来源:comboboxes.py
示例7: postprocess_keyevent
def postprocess_keyevent(self, event):
"""Process keypress event"""
ShellBaseWidget.postprocess_keyevent(self, event)
if QToolTip.isVisible():
_event, _text, key, _ctrl, _shift = restore_keyevent(event)
self.hide_tooltip_if_necessary(key)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:6,代码来源:shell.py
示例8: mouseReleaseEvent
def mouseReleaseEvent(self, event):
QToolTip.showText(self.mapToGlobal(QPoint(0, self.height())),
self._tip_text)
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:3,代码来源:helperwidgets.py
示例9: mousePressEvent
def mousePressEvent(self, event):
QToolTip.hideText()
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:2,代码来源:helperwidgets.py
示例10: mouseReleaseEvent
def mouseReleaseEvent(self, event):
""" """
QToolTip.showText(self.mapToGlobal(QPoint(0, 0)), self._tip_text)
开发者ID:ImadBouirmane,项目名称:spyder,代码行数:3,代码来源:arraybuilder.py
注:本文中的spyderlib.qt.QtGui.QToolTip类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论