[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qtooltip.cpp:643 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QToolTip Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QToolTip Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QToolTip class provides tool tips (balloon help) for
|
---|
| 35 | any widget or rectangular part of a widget.
|
---|
| 36 | <a href="#details">More...</a>
|
---|
| 37 | <p><tt>#include <<a href="qtooltip-h.html">qtooltip.h</a>></tt>
|
---|
| 38 | <p>Inherits <a href="qt.html">Qt</a>.
|
---|
| 39 | <p><a href="qtooltip-members.html">List of all member functions.</a>
|
---|
| 40 | <h2>Public Members</h2>
|
---|
| 41 | <ul>
|
---|
| 42 | <li class=fn><a href="#QToolTip"><b>QToolTip</b></a> ( QWidget * widget, QToolTipGroup * group = 0 )</li>
|
---|
| 43 | <li class=fn>QWidget * <a href="#parentWidget"><b>parentWidget</b></a> () const</li>
|
---|
| 44 | <li class=fn>QToolTipGroup * <a href="#group"><b>group</b></a> () const</li>
|
---|
| 45 | </ul>
|
---|
| 46 | <h2>Static Public Members</h2>
|
---|
| 47 | <ul>
|
---|
| 48 | <li class=fn>void <a href="#add"><b>add</b></a> ( QWidget * widget, const QString & text )</li>
|
---|
| 49 | <li class=fn>void <a href="#add-2"><b>add</b></a> ( QWidget * widget, const QString & text, QToolTipGroup * group, const QString & longText )</li>
|
---|
| 50 | <li class=fn>void <a href="#remove"><b>remove</b></a> ( QWidget * widget )</li>
|
---|
| 51 | <li class=fn>void <a href="#add-3"><b>add</b></a> ( QWidget * widget, const QRect & rect, const QString & text )</li>
|
---|
| 52 | <li class=fn>void <a href="#add-4"><b>add</b></a> ( QWidget * widget, const QRect & rect, const QString & text, QToolTipGroup * group, const QString & groupText )</li>
|
---|
| 53 | <li class=fn>void <a href="#remove-2"><b>remove</b></a> ( QWidget * widget, const QRect & rect )</li>
|
---|
| 54 | <li class=fn>QString <a href="#textFor"><b>textFor</b></a> ( QWidget * widget, const QPoint & pos = QPoint ( ) )</li>
|
---|
| 55 | <li class=fn>void <a href="#hide"><b>hide</b></a> ()</li>
|
---|
| 56 | <li class=fn>QFont <a href="#font"><b>font</b></a> ()</li>
|
---|
| 57 | <li class=fn>void <a href="#setFont"><b>setFont</b></a> ( const QFont & font )</li>
|
---|
| 58 | <li class=fn>QPalette <a href="#palette"><b>palette</b></a> ()</li>
|
---|
| 59 | <li class=fn>void <a href="#setPalette"><b>setPalette</b></a> ( const QPalette & palette )</li>
|
---|
| 60 | <li class=fn>void setEnabled ( bool enable ) <em>(obsolete)</em></li>
|
---|
| 61 | <li class=fn>bool enabled () <em>(obsolete)</em></li>
|
---|
| 62 | <li class=fn>void <a href="#setGloballyEnabled"><b>setGloballyEnabled</b></a> ( bool enable )</li>
|
---|
| 63 | <li class=fn>bool <a href="#isGloballyEnabled"><b>isGloballyEnabled</b></a> ()</li>
|
---|
| 64 | <li class=fn>void <a href="#setWakeUpDelay"><b>setWakeUpDelay</b></a> ( int i )</li>
|
---|
| 65 | </ul>
|
---|
| 66 | <h2>Protected Members</h2>
|
---|
| 67 | <ul>
|
---|
| 68 | <li class=fn>virtual void <a href="#maybeTip"><b>maybeTip</b></a> ( const QPoint & p ) = 0</li>
|
---|
| 69 | <li class=fn>void <a href="#tip"><b>tip</b></a> ( const QRect & rect, const QString & text )</li>
|
---|
| 70 | <li class=fn>void <a href="#tip-2"><b>tip</b></a> ( const QRect & rect, const QString & text, const QString & groupText )</li>
|
---|
| 71 | <li class=fn>void <a href="#tip-3"><b>tip</b></a> ( const QRect & rect, const QString & text, const QRect & geometry )</li>
|
---|
| 72 | <li class=fn>void <a href="#tip-4"><b>tip</b></a> ( const QRect & rect, const QString & text, const QString & groupText, const QRect & geometry )</li>
|
---|
| 73 | <li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
|
---|
| 74 | </ul>
|
---|
| 75 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 | The QToolTip class provides tool tips (balloon help) for
|
---|
| 79 | any widget or rectangular part of a widget.
|
---|
| 80 | <p>
|
---|
| 81 |
|
---|
| 82 | <p> The tip is a short, single line of text reminding the user of the
|
---|
| 83 | widget's or rectangle's function. It is drawn immediately below
|
---|
| 84 | the region in a distinctive black-on-yellow combination.
|
---|
| 85 | <p> The tip can be any Rich-Text formatted string.
|
---|
| 86 | <p> <a href="qtooltipgroup.html">QToolTipGroup</a> provides a way for tool tips to display another text
|
---|
| 87 | elsewhere (most often in a <a href="qstatusbar.html">status bar</a>).
|
---|
| 88 | <p> At any point in time, QToolTip is either dormant or active. In
|
---|
| 89 | dormant mode the tips are not shown and in active mode they are.
|
---|
| 90 | The mode is global, not particular to any one widget.
|
---|
| 91 | <p> QToolTip switches from dormant to active mode when the user hovers
|
---|
| 92 | the mouse on a tip-equipped region for a second or so and remains
|
---|
| 93 | active until the user either clicks a mouse button, presses a key,
|
---|
| 94 | lets the mouse hover for five seconds or moves the mouse outside
|
---|
| 95 | <em>all</em> tip-equipped regions for at least a second.
|
---|
| 96 | <p> The QToolTip class can be used in three different ways:
|
---|
| 97 | <ol type=1>
|
---|
| 98 | <li> Adding a tip to an entire widget.
|
---|
| 99 | <li> Adding a tip to a fixed rectangle within a widget.
|
---|
| 100 | <li> Adding a tip to a dynamic rectangle within a widget.
|
---|
| 101 | </ol>
|
---|
| 102 | <p> To add a tip to a widget, call the <em>static</em> function
|
---|
| 103 | <a href="#add">QToolTip::add</a>() with the widget and tip as arguments:
|
---|
| 104 | <p> <pre>
|
---|
| 105 | QToolTip::<a href="#add">add</a>( quitButton, "Leave the application" );
|
---|
| 106 | </pre>
|
---|
| 107 |
|
---|
| 108 | <p> This is the simplest and most common use of QToolTip. The tip
|
---|
| 109 | will be deleted automatically when <em>quitButton</em> is deleted, but
|
---|
| 110 | you can remove it yourself, too:
|
---|
| 111 | <p> <pre>
|
---|
| 112 | QToolTip::<a href="#remove">remove</a>( quitButton );
|
---|
| 113 | </pre>
|
---|
| 114 |
|
---|
| 115 | <p> You can also display another text (typically in a <a href="qstatusbar.html">status bar),</a> courtesy of <a href="qtooltipgroup.html">QToolTipGroup</a>. This example
|
---|
| 116 | assumes that <em>grp</em> is a <tt>QToolTipGroup *</tt> and is already
|
---|
| 117 | connected to the appropriate status bar:
|
---|
| 118 | <p> <pre>
|
---|
| 119 | QToolTip::<a href="#add">add</a>( quitButton, "Leave the application", grp,
|
---|
| 120 | "Leave the application, prompting to save if necessary" );
|
---|
| 121 | QToolTip::<a href="#add">add</a>( closeButton, "Close this window", grp,
|
---|
| 122 | "Close this window, prompting to save if necessary" );
|
---|
| 123 | </pre>
|
---|
| 124 |
|
---|
| 125 | <p> To add a tip to a fixed rectangle within a widget, call the static
|
---|
| 126 | function <a href="#add">QToolTip::add</a>() with the widget, rectangle and tip as
|
---|
| 127 | arguments. (See the <a href="tooltip-example.html">tooltip/tooltip.cpp</a> example.) Again, you
|
---|
| 128 | can supply a <tt>QToolTipGroup *</tt> and another text if you want.
|
---|
| 129 | <p> Both of these are one-liners and cover the majority of cases. The
|
---|
| 130 | third and most general way to use QToolTip requires you to
|
---|
| 131 | reimplement a pure virtual function to decide whether to pop up a
|
---|
| 132 | tool tip. The <a href="tooltip-example.html">tooltip/tooltip.cpp</a> example demonstrates this
|
---|
| 133 | too. This mode can be used to implement tips for text that can
|
---|
| 134 | move as the user scrolls, for example.
|
---|
| 135 | <p> To use QToolTip like this, you must subclass QToolTip and
|
---|
| 136 | reimplement <a href="#maybeTip">maybeTip</a>(). QToolTip calls maybeTip() when a tip
|
---|
| 137 | should pop up, and maybeTip() decides whether to show a tip.
|
---|
| 138 | <p> Tool tips can be globally disabled using
|
---|
| 139 | <a href="#setGloballyEnabled">QToolTip::setGloballyEnabled</a>() or disabled in groups with
|
---|
| 140 | <a href="qtooltipgroup.html#setEnabled">QToolTipGroup::setEnabled</a>().
|
---|
| 141 | <p> You can retrieve the text of a tooltip for a given position within
|
---|
| 142 | a widget using <a href="#textFor">textFor</a>().
|
---|
| 143 | <p> The global tooltip font and palette can be set with the static
|
---|
| 144 | <a href="#setFont">setFont</a>() and <a href="#setPalette">setPalette</a>() functions respectively.
|
---|
| 145 | <p> <p>See also <a href="qstatusbar.html">QStatusBar</a>, <a href="qwhatsthis.html">QWhatsThis</a>, <a href="qtooltipgroup.html">QToolTipGroup</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Tool Tip</a>, and <a href="helpsystem.html">Help System</a>.
|
---|
| 146 |
|
---|
| 147 | <hr><h2>Member Function Documentation</h2>
|
---|
| 148 | <h3 class=fn><a name="QToolTip"></a>QToolTip::QToolTip ( <a href="qwidget.html">QWidget</a> * widget, <a href="qtooltipgroup.html">QToolTipGroup</a> * group = 0 )
|
---|
| 149 | </h3>
|
---|
| 150 | Constructs a tool tip object. This is only necessary if you need
|
---|
| 151 | tool tips on regions that can move within the widget (most often
|
---|
| 152 | because the widget's contents can scroll).
|
---|
| 153 | <p> <em>widget</em> is the widget you want to add dynamic tool tips to and
|
---|
| 154 | <em>group</em> (optional) is the tool tip group they should belong to.
|
---|
| 155 | <p> <b>Warning:</b> QToolTip is not a subclass of <a href="qobject.html">QObject</a>, so the instance of
|
---|
| 156 | QToolTip is not deleted when <em>widget</em> is deleted.
|
---|
| 157 | <p> <b>Warning:</b> If you delete the tool tip before you have deleted
|
---|
| 158 | <em>widget</em> then you need to make sure you call <a href="#remove">remove</a>() yourself from
|
---|
| 159 | <em>widget</em> in your reimplemented QToolTip destructor.
|
---|
| 160 | <p> <pre>
|
---|
| 161 | MyToolTip::~MyToolTip()
|
---|
| 162 | {
|
---|
| 163 | <a href="#remove">remove</a>( widget );
|
---|
| 164 | }
|
---|
| 165 | </pre>
|
---|
| 166 |
|
---|
| 167 | <p> <p>See also <a href="#maybeTip">maybeTip</a>().
|
---|
| 168 |
|
---|
| 169 | <h3 class=fn>void <a name="add"></a>QToolTip::add ( <a href="qwidget.html">QWidget</a> * widget, const <a href="qstring.html">QString</a> & text )<tt> [static]</tt>
|
---|
| 170 | </h3>
|
---|
| 171 | Adds a tool tip to <em>widget</em>. <em>text</em> is the text to be shown in
|
---|
| 172 | the tool tip.
|
---|
| 173 | <p> This is the most common entry point to the QToolTip class; it is
|
---|
| 174 | suitable for adding tool tips to buttons, checkboxes, comboboxes
|
---|
| 175 | and so on.
|
---|
| 176 |
|
---|
| 177 | <p>Examples: <a href="helpsystem-example.html#x2695">helpsystem/mainwindow.cpp</a>, <a href="qdir-example.html#x1848">qdir/qdir.cpp</a>, <a href="scribble-example.html#x945">scribble/scribble.cpp</a>, and <a href="tooltip-example.html#x450">tooltip/tooltip.cpp</a>.
|
---|
| 178 | <h3 class=fn>void <a name="add-2"></a>QToolTip::add ( <a href="qwidget.html">QWidget</a> * widget, const <a href="qstring.html">QString</a> & text, <a href="qtooltipgroup.html">QToolTipGroup</a> * group, const <a href="qstring.html">QString</a> & longText )<tt> [static]</tt>
|
---|
| 179 | </h3>
|
---|
| 180 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 181 | <p> Adds a tool tip to <em>widget</em> and to tool tip group <em>group</em>.
|
---|
| 182 | <p> <em>text</em> is the text shown in the tool tip and <em>longText</em> is the
|
---|
| 183 | text emitted from <em>group</em>.
|
---|
| 184 | <p> Normally, <em>longText</em> is shown in a <a href="qstatusbar.html">status
|
---|
| 185 | bar</a> or similar.
|
---|
| 186 |
|
---|
| 187 | <h3 class=fn>void <a name="add-3"></a>QToolTip::add ( <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & rect, const <a href="qstring.html">QString</a> & text )<tt> [static]</tt>
|
---|
| 188 | </h3>
|
---|
| 189 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 190 | <p> Adds a tool tip to a fixed rectangle, <em>rect</em>, within <em>widget</em>.
|
---|
| 191 | <em>text</em> is the text shown in the tool tip.
|
---|
| 192 |
|
---|
| 193 | <h3 class=fn>void <a name="add-4"></a>QToolTip::add ( <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & rect, const <a href="qstring.html">QString</a> & text, <a href="qtooltipgroup.html">QToolTipGroup</a> * group, const <a href="qstring.html">QString</a> & groupText )<tt> [static]</tt>
|
---|
| 194 | </h3>
|
---|
| 195 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 196 | <p> Adds a tool tip to an entire <em>widget</em> and to tool tip group <em>group</em>. The tooltip will disappear when the mouse leaves the <em>rect</em>.
|
---|
| 197 | <p> <em>text</em> is the text shown in the tool tip and <em>groupText</em> is the
|
---|
| 198 | text emitted from <em>group</em>.
|
---|
| 199 | <p> Normally, <em>groupText</em> is shown in a <a href="qstatusbar.html">status
|
---|
| 200 | bar</a> or similar.
|
---|
| 201 |
|
---|
| 202 | <h3 class=fn>void <a name="clear"></a>QToolTip::clear ()<tt> [protected]</tt>
|
---|
| 203 | </h3>
|
---|
| 204 | Immediately removes all tool tips for this tooltip's parent
|
---|
| 205 | widget.
|
---|
| 206 |
|
---|
| 207 | <h3 class=fn>bool <a name="enabled"></a>QToolTip::enabled ()<tt> [static]</tt>
|
---|
| 208 | </h3>
|
---|
| 209 |
|
---|
| 210 | <p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 211 | <p>
|
---|
| 212 | <h3 class=fn><a href="qfont.html">QFont</a> <a name="font"></a>QToolTip::font ()<tt> [static]</tt>
|
---|
| 213 | </h3>
|
---|
| 214 | Returns the font common to all tool tips.
|
---|
| 215 | <p> <p>See also <a href="#setFont">setFont</a>().
|
---|
| 216 |
|
---|
| 217 | <h3 class=fn><a href="qtooltipgroup.html">QToolTipGroup</a> * <a name="group"></a>QToolTip::group () const
|
---|
| 218 | </h3>
|
---|
| 219 |
|
---|
| 220 | <p> Returns the tool tip group this QToolTip is a member of or 0 if it
|
---|
| 221 | isn't a member of any group.
|
---|
| 222 | <p> The tool tip group is the object responsible for maintaining
|
---|
| 223 | contact between tool tips and a <a href="qstatusbar.html">status
|
---|
| 224 | bar</a> or something else which can show the longer help text.
|
---|
| 225 | <p> <p>See also <a href="#parentWidget">parentWidget</a>() and <a href="qtooltipgroup.html">QToolTipGroup</a>.
|
---|
| 226 |
|
---|
| 227 | <h3 class=fn>void <a name="hide"></a>QToolTip::hide ()<tt> [static]</tt>
|
---|
| 228 | </h3>
|
---|
| 229 | Hides any tip that is currently being shown.
|
---|
| 230 | <p> Normally, there is no need to call this function; QToolTip takes
|
---|
| 231 | care of showing and hiding the tips as the user moves the mouse.
|
---|
| 232 |
|
---|
| 233 | <h3 class=fn>bool <a name="isGloballyEnabled"></a>QToolTip::isGloballyEnabled ()<tt> [static]</tt>
|
---|
| 234 | </h3>
|
---|
| 235 | Returns whether tool tips are enabled globally.
|
---|
| 236 | <p> <p>See also <a href="#setGloballyEnabled">setGloballyEnabled</a>().
|
---|
| 237 |
|
---|
| 238 | <h3 class=fn>void <a name="maybeTip"></a>QToolTip::maybeTip ( const <a href="qpoint.html">QPoint</a> & p )<tt> [pure virtual protected]</tt>
|
---|
| 239 | </h3>
|
---|
| 240 |
|
---|
| 241 | <p> This pure virtual function is half of the most versatile interface
|
---|
| 242 | QToolTip offers.
|
---|
| 243 | <p> It is called when there is a possibility that a tool tip should be
|
---|
| 244 | shown and must decide whether there is a tool tip for the point <em>p</em> in the widget that this QToolTip object relates to. If so,
|
---|
| 245 | <a href="#maybeTip">maybeTip</a>() must call <a href="#tip">tip</a>() with the rectangle the tip applies to,
|
---|
| 246 | the tip's text and optionally the <a href="qtooltipgroup.html">QToolTipGroup</a> details and the
|
---|
| 247 | geometry in screen coordinates.
|
---|
| 248 | <p> <em>p</em> is given in that widget's local coordinates. Most maybeTip()
|
---|
| 249 | implementations will be of the form:
|
---|
| 250 | <p> <pre>
|
---|
| 251 | if ( <something> ) {
|
---|
| 252 | <a href="#tip">tip</a>( <something>, <something> );
|
---|
| 253 | }
|
---|
| 254 | </pre>
|
---|
| 255 |
|
---|
| 256 | <p> The first argument to tip() (a rectangle) must encompass <em>p</em>,
|
---|
| 257 | i.e. the tip must apply to the current mouse position; otherwise
|
---|
| 258 | QToolTip's operation is undefined.
|
---|
| 259 | <p> Note that the tip will disappear once the mouse moves outside the
|
---|
| 260 | rectangle you give to tip(), and will not reappear if the mouse
|
---|
| 261 | moves back in: maybeTip() is called again instead.
|
---|
| 262 | <p> <p>See also <a href="#tip">tip</a>().
|
---|
| 263 |
|
---|
| 264 | <p>Examples: <a href="helpsystem-example.html#x2684">helpsystem/tooltip.cpp</a> and <a href="tooltip-example.html#x451">tooltip/tooltip.cpp</a>.
|
---|
| 265 | <h3 class=fn><a href="qpalette.html">QPalette</a> <a name="palette"></a>QToolTip::palette ()<tt> [static]</tt>
|
---|
| 266 | </h3>
|
---|
| 267 | Returns the palette common to all tool tips.
|
---|
| 268 | <p> <p>See also <a href="#setPalette">setPalette</a>().
|
---|
| 269 |
|
---|
| 270 | <h3 class=fn><a href="qwidget.html">QWidget</a> * <a name="parentWidget"></a>QToolTip::parentWidget () const
|
---|
| 271 | </h3>
|
---|
| 272 |
|
---|
| 273 | <p> Returns the widget this QToolTip applies to.
|
---|
| 274 | <p> The tool tip is destroyed automatically when the parent widget is
|
---|
| 275 | destroyed.
|
---|
| 276 | <p> <p>See also <a href="#group">group</a>().
|
---|
| 277 |
|
---|
| 278 | <h3 class=fn>void <a name="remove"></a>QToolTip::remove ( <a href="qwidget.html">QWidget</a> * widget )<tt> [static]</tt>
|
---|
| 279 | </h3>
|
---|
| 280 | Removes the tool tip from <em>widget</em>.
|
---|
| 281 | <p> If there is more than one tool tip on <em>widget</em>, only the one
|
---|
| 282 | covering the entire widget is removed.
|
---|
| 283 |
|
---|
| 284 | <h3 class=fn>void <a name="remove-2"></a>QToolTip::remove ( <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & rect )<tt> [static]</tt>
|
---|
| 285 | </h3>
|
---|
| 286 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 287 | <p> Removes any tool tip for <em>rect</em> from <em>widget</em>.
|
---|
| 288 | <p> If there is more than one tool tip on <em>widget</em>, only the one
|
---|
| 289 | covering rectangle <em>rect</em> is removed.
|
---|
| 290 |
|
---|
| 291 | <h3 class=fn>void <a name="setEnabled"></a>QToolTip::setEnabled ( bool enable )<tt> [static]</tt>
|
---|
| 292 | </h3>
|
---|
| 293 |
|
---|
| 294 | <p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 295 | <p>
|
---|
| 296 | <h3 class=fn>void <a name="setFont"></a>QToolTip::setFont ( const <a href="qfont.html">QFont</a> & font )<tt> [static]</tt>
|
---|
| 297 | </h3>
|
---|
| 298 | Sets the font for all tool tips to <em>font</em>.
|
---|
| 299 | <p> <p>See also <a href="#font">font</a>().
|
---|
| 300 |
|
---|
| 301 | <h3 class=fn>void <a name="setGloballyEnabled"></a>QToolTip::setGloballyEnabled ( bool enable )<tt> [static]</tt>
|
---|
| 302 | </h3>
|
---|
| 303 | If <em>enable</em> is TRUE sets all tool tips to be enabled (shown when
|
---|
| 304 | needed); if <em>enable</em> is FALSE sets all tool tips to be disabled
|
---|
| 305 | (never shown).
|
---|
| 306 | <p> By default, tool tips are enabled. Note that this function affects
|
---|
| 307 | all tool tips in the entire application.
|
---|
| 308 | <p> <p>See also <a href="qtooltipgroup.html#enabled-prop">QToolTipGroup::enabled</a>.
|
---|
| 309 |
|
---|
| 310 | <h3 class=fn>void <a name="setPalette"></a>QToolTip::setPalette ( const <a href="qpalette.html">QPalette</a> & palette )<tt> [static]</tt>
|
---|
| 311 | </h3>
|
---|
| 312 | Sets the palette for all tool tips to <em>palette</em>.
|
---|
| 313 | <p> <p>See also <a href="#palette">palette</a>().
|
---|
| 314 |
|
---|
| 315 | <h3 class=fn>void <a name="setWakeUpDelay"></a>QToolTip::setWakeUpDelay ( int i )<tt> [static]</tt>
|
---|
| 316 | </h3>
|
---|
| 317 | Sets the wakeup delay for all tooltips to <em>i</em>
|
---|
| 318 | milliseconds.
|
---|
| 319 |
|
---|
| 320 | <h3 class=fn><a href="qstring.html">QString</a> <a name="textFor"></a>QToolTip::textFor ( <a href="qwidget.html">QWidget</a> * widget, const <a href="qpoint.html">QPoint</a> & pos = QPoint ( ) )<tt> [static]</tt>
|
---|
| 321 | </h3>
|
---|
| 322 | Returns the tool tip text for <em>widget</em> at position <em>pos</em>, or
|
---|
| 323 | <a href="qstring.html#QString-null">QString::null</a> if there is no tool tip for the given widget and
|
---|
| 324 | position.
|
---|
| 325 |
|
---|
| 326 | <h3 class=fn>void <a name="tip"></a>QToolTip::tip ( const <a href="qrect.html">QRect</a> & rect, const <a href="qstring.html">QString</a> & text )<tt> [protected]</tt>
|
---|
| 327 | </h3>
|
---|
| 328 | Immediately pops up a tip saying <em>text</em> and removes the tip once
|
---|
| 329 | the cursor moves out of rectangle <em>rect</em> (which is given in the
|
---|
| 330 | coordinate system of the widget this QToolTip relates to).
|
---|
| 331 | <p> The tip will not reappear if the cursor moves back; your
|
---|
| 332 | <a href="#maybeTip">maybeTip</a>() must reinstate it each time.
|
---|
| 333 |
|
---|
| 334 | <h3 class=fn>void <a name="tip-2"></a>QToolTip::tip ( const <a href="qrect.html">QRect</a> & rect, const <a href="qstring.html">QString</a> & text, const <a href="qstring.html">QString</a> & groupText )<tt> [protected]</tt>
|
---|
| 335 | </h3>
|
---|
| 336 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 337 | <p> Immediately pops up a tip saying <em>text</em> and removes that tip once
|
---|
| 338 | the cursor moves out of rectangle <em>rect</em> (which is given in the
|
---|
| 339 | coordinate system of the widget this QToolTip relates to). <em>groupText</em> is the text emitted from the group.
|
---|
| 340 | <p> The tip will not reappear if the cursor moves back; your
|
---|
| 341 | <a href="#maybeTip">maybeTip</a>() must reinstate it each time.
|
---|
| 342 |
|
---|
| 343 | <h3 class=fn>void <a name="tip-3"></a>QToolTip::tip ( const <a href="qrect.html">QRect</a> & rect, const <a href="qstring.html">QString</a> & text, const <a href="qrect.html">QRect</a> & geometry )<tt> [protected]</tt>
|
---|
| 344 | </h3>
|
---|
| 345 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 346 | <p> Immediately pops up a tip within the rectangle <em>geometry</em>, saying
|
---|
| 347 | <em>text</em> and removes the tip once the cursor moves out of rectangle
|
---|
| 348 | <em>rect</em>. Both rectangles are given in the coordinate system of the
|
---|
| 349 | widget this QToolTip relates to.
|
---|
| 350 | <p> The tip will not reappear if the cursor moves back; your
|
---|
| 351 | <a href="#maybeTip">maybeTip</a>() must reinstate it each time.
|
---|
| 352 | <p> If the tip does not fit inside <em>geometry</em>, the tip expands.
|
---|
| 353 |
|
---|
| 354 | <h3 class=fn>void <a name="tip-4"></a>QToolTip::tip ( const <a href="qrect.html">QRect</a> & rect, const <a href="qstring.html">QString</a> & text, const <a href="qstring.html">QString</a> & groupText, const <a href="qrect.html">QRect</a> & geometry )<tt> [protected]</tt>
|
---|
| 355 | </h3>
|
---|
| 356 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 357 | <p> Immediately pops up a tip within the rectangle <em>geometry</em>, saying
|
---|
| 358 | <em>text</em> and removes the tip once the cursor moves out of rectangle
|
---|
| 359 | <em>rect</em>. <em>groupText</em> is the text emitted from the group. Both
|
---|
| 360 | rectangles are given in the coordinate system of the widget this
|
---|
| 361 | QToolTip relates to.
|
---|
| 362 | <p> The tip will not reappear if the cursor moves back; your
|
---|
| 363 | <a href="#maybeTip">maybeTip</a>() must reinstate it each time.
|
---|
| 364 | <p> If the tip does not fit inside <em>geometry</em>, the tip expands.
|
---|
| 365 |
|
---|
| 366 | <!-- eof -->
|
---|
| 367 | <hr><p>
|
---|
| 368 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 369 | Copyright © 1995-2007
|
---|
| 370 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 371 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 372 | <td>Copyright © 2007
|
---|
| 373 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 374 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 375 | </table></div></address></body>
|
---|
| 376 | </html>
|
---|