Home · All Classes · Modules

QToolTip Class Reference
[QtGui module]

The QToolTip class provides tool tips (balloon help) for any widget. More...

Methods

Static Methods


Detailed Description

The QToolTip class provides tool tips (balloon help) for any widget.

The tip is a short piece of text reminding the user of the widget's function. It is drawn immediately below the given position in a distinctive black-on-yellow color combination. The tip can be any rich text formatted string.

Rich text formatted tips implictely do word breaking, unless specified differently with <p style='white-space:pre'>.

The simplest and most common way to set a widget's tooltip is by calling its QWidget.setToolTip() function.

It is also possible to show different tool tips for different regions of a widget, by using a QHelpEvent of type QEvent.ToolTip. Intercept the help event in your widget's QWidget.event() function and call QToolTip.showText() with the text you want to display. The Tooltips example illustrates this technique.

See also QWidget.toolTip and QAction.toolTip.


Method Documentation

QToolTip.__init__ (self, QToolTip)

QPalette QToolTip.palette ()

Returns the palette used to render tooltips.

QToolTip.showText (QPoint pos, QString text, QWidget w = None)

Shows text as a tool tip, at global position pos. The optional widget argument, w, is used to determine the appropriate screen on multi-head systems. If text is empty the tool tip is hidden.


PyQt 4.0.1 for X11Copyright © Riverbank Computing Ltd and Trolltech AS 2006Qt 4.1.4