The tip is a short, single line of text reminding the user of the widget's or rectangle's function. It is drawn immediately below the region in a distinctive black-on-yellow combination.
At any point in time, TQToolTip is either dormant or active. In dormant mode the tips are not shown and in active mode they are. The mode is global, not particular to any one widget.
TQToolTip switches from dormant to active mode when the user hovers the mouse on a tip-equipped region for a second or so and remains active until the user either clicks a mouse button, presses a key, lets the mouse hover for five seconds or moves the mouse outside \fIall\fR tip-equipped regions for at least a second.
This is the simplest and most common use of TQToolTip. The tip will be deleted automatically when \fIquitButton\fR is deleted, but you can remove it yourself, too:
You can also display another text (typically in a status bar), courtesy of TQToolTipGroup. This example assumes that \fIgrp\fR is a \fCTQToolTipGroup *\fR and is already connected to the appropriate status bar:
To add a tip to a fixed rectangle within a widget, call the static function TQToolTip::add() with the widget, rectangle and tip as arguments. (See the tooltip/tooltip.cpp example.) Again, you can supply a \fCTQToolTipGroup *\fR and another text if you want.
Both of these are one-liners and cover the majority of cases. The third and most general way to use TQToolTip requires you to reimplement a pure virtual function to decide whether to pop up a tool tip. The tooltip/tooltip.cpp example demonstrates this too. This mode can be used to implement tips for text that can move as the user scrolls, for example.
To use TQToolTip like this, you must subclass TQToolTip and reimplement maybeTip(). TQToolTip calls maybeTip() when a tip should pop up, and maybeTip() decides whether to show a tip.
Constructs a tool tip object. This is only necessary if you need tool tips on regions that can move within the widget (most often because the widget's contents can scroll).
.PP
\fIwidget\fR is the widget you want to add dynamic tool tips to and \fIgroup\fR (optional) is the tool tip group they should belong to.
\fBWarning:\fR If you delete the tool tip before you have deleted \fIwidget\fR then you need to make sure you call remove() yourself from \fIwidget\fR in your reimplemented TQToolTip destructor.
The tool tip group is the object responsible for maintaining contact between tool tips and a status bar or something else which can show the longer help text.
It is called when there is a possibility that a tool tip should be shown and must decide whether there is a tool tip for the point \fIp\fR in the widget that this TQToolTip object relates to. If so, maybeTip() must call tip() with the rectangle the tip applies to, the tip's text and optionally the TQToolTipGroup details and the geometry in screen coordinates.
The first argument to tip() (a rectangle) must encompass \fIp\fR, i.e. the tip must apply to the current mouse position; otherwise TQToolTip's operation is undefined.
Note that the tip will disappear once the mouse moves outside the rectangle you give to tip(), and will not reappear if the mouse moves back in: maybeTip() is called again instead.
.PP
See also tip().
.PP
Examples:
.)l helpsystem/tooltip.cpp and tooltip/tooltip.cpp.
If \fIenable\fR is TRUE sets all tool tips to be enabled (shown when needed); if \fIenable\fR is FALSE sets all tool tips to be disabled (never shown).
.PP
By default, tool tips are enabled. Note that this function affects all tool tips in the entire application.
Immediately pops up a tip saying \fItext\fR and removes the tip once the cursor moves out of rectangle \fIrect\fR (which is given in the coordinate system of the widget this TQToolTip relates to).
Immediately pops up a tip saying \fItext\fR and removes that tip once the cursor moves out of rectangle \fIrect\fR (which is given in the coordinate system of the widget this TQToolTip relates to). \fIgroupText\fR is the text emitted from the group.
Immediately pops up a tip within the rectangle \fIgeometry\fR, saying \fItext\fR and removes the tip once the cursor moves out of rectangle \fIrect\fR. Both rectangles are given in the coordinate system of the widget this TQToolTip relates to.
Immediately pops up a tip within the rectangle \fIgeometry\fR, saying \fItext\fR and removes the tip once the cursor moves out of rectangle \fIrect\fR. \fIgroupText\fR is the text emitted from the group. Both rectangles are given in the coordinate system of the widget this TQToolTip relates to.