/usr/share/qt3/doc/html/qdial.html is in qt3-doc 3:3.3.8-b-8ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qdial.cpp:86 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QDial Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QDial Class Reference</h1>
<p>The QDial class provides a rounded range control (like a speedometer or potentiometer).
<a href="#details">More...</a>
<p><tt>#include <<a href="qdial-h.html">qdial.h</a>></tt>
<p>Inherits <a href="qwidget.html">QWidget</a> and <a href="qrangecontrol.html">QRangeControl</a>.
<p><a href="qdial-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#QDial"><b>QDial</b></a> ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 )</li>
<li class=fn><a href="#QDial-2"><b>QDial</b></a> ( int minValue, int maxValue, int pageStep, int value, QWidget * parent = 0, const char * name = 0 )</li>
<li class=fn><a href="#~QDial"><b>~QDial</b></a> ()</li>
<li class=fn>bool <a href="#tracking"><b>tracking</b></a> () const</li>
<li class=fn>bool <a href="#wrapping"><b>wrapping</b></a> () const</li>
<li class=fn>int <a href="#notchSize"><b>notchSize</b></a> () const</li>
<li class=fn>virtual void <a href="#setNotchTarget"><b>setNotchTarget</b></a> ( double )</li>
<li class=fn>double <a href="#notchTarget"><b>notchTarget</b></a> () const</li>
<li class=fn>bool <a href="#notchesVisible"><b>notchesVisible</b></a> () const</li>
<li class=fn>int <a href="#minValue"><b>minValue</b></a> () const</li>
<li class=fn>int <a href="#maxValue"><b>maxValue</b></a> () const</li>
<li class=fn>void <a href="#setMinValue"><b>setMinValue</b></a> ( int )</li>
<li class=fn>void <a href="#setMaxValue"><b>setMaxValue</b></a> ( int )</li>
<li class=fn>int <a href="#lineStep"><b>lineStep</b></a> () const</li>
<li class=fn>int <a href="#pageStep"><b>pageStep</b></a> () const</li>
<li class=fn>void <a href="#setLineStep"><b>setLineStep</b></a> ( int )</li>
<li class=fn>void <a href="#setPageStep"><b>setPageStep</b></a> ( int )</li>
<li class=fn>int <a href="#value"><b>value</b></a> () const</li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>virtual void <a href="#setValue"><b>setValue</b></a> ( int )</li>
<li class=fn>void <a href="#addLine"><b>addLine</b></a> ()</li>
<li class=fn>void <a href="#subtractLine"><b>subtractLine</b></a> ()</li>
<li class=fn>void <a href="#addPage"><b>addPage</b></a> ()</li>
<li class=fn>void <a href="#subtractPage"><b>subtractPage</b></a> ()</li>
<li class=fn>virtual void <a href="#setNotchesVisible"><b>setNotchesVisible</b></a> ( bool b )</li>
<li class=fn>virtual void <a href="#setWrapping"><b>setWrapping</b></a> ( bool on )</li>
<li class=fn>virtual void <a href="#setTracking"><b>setTracking</b></a> ( bool enable )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#valueChanged"><b>valueChanged</b></a> ( int value )</li>
<li class=fn>void <a href="#dialPressed"><b>dialPressed</b></a> ()</li>
<li class=fn>void <a href="#dialMoved"><b>dialMoved</b></a> ( int value )</li>
<li class=fn>void <a href="#dialReleased"><b>dialReleased</b></a> ()</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>int <a href="#lineStep-prop"><b>lineStep</b></a> - the current line step</li>
<li class=fn>int <a href="#maxValue-prop"><b>maxValue</b></a> - the current maximum value</li>
<li class=fn>int <a href="#minValue-prop"><b>minValue</b></a> - the current minimum value</li>
<li class=fn>int <a href="#notchSize-prop"><b>notchSize</b></a> - the current notch size <em>(read only)</em></li>
<li class=fn>double <a href="#notchTarget-prop"><b>notchTarget</b></a> - the target number of pixels between notches</li>
<li class=fn>bool <a href="#notchesVisible-prop"><b>notchesVisible</b></a> - whether the notches are shown</li>
<li class=fn>int <a href="#pageStep-prop"><b>pageStep</b></a> - the current page step</li>
<li class=fn>bool <a href="#tracking-prop"><b>tracking</b></a> - whether tracking is enabled</li>
<li class=fn>int <a href="#value-prop"><b>value</b></a> - the current dial value</li>
<li class=fn>bool <a href="#wrapping-prop"><b>wrapping</b></a> - whether wrapping is enabled</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#valueChange"><b>valueChange</b></a> ()</li>
<li class=fn>virtual void <a href="#rangeChange"><b>rangeChange</b></a> ()</li>
<li class=fn>virtual void <a href="#repaintScreen"><b>repaintScreen</b></a> ( const QRect * cr = 0 )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
<p> The QDial class provides a rounded range control (like a speedometer or potentiometer).
<p>
<p> QDial is used when the user needs to control a value within a
program-definable range, and the range either wraps around
(typically, 0..359 degrees) or the dialog layout needs a square
widget.
<p> Both API- and UI-wise, the dial is very similar to a <a href="qslider.html">slider.</a> Indeed, when <a href="#wrapping">wrapping</a>() is FALSE (the default)
there is no real difference between a slider and a dial. They
have the same signals, slots and member functions, all of which do
the same things. Which one you use depends only on your taste
and on the application.
<p> The dial initially emits <a href="#valueChanged">valueChanged</a>() signals continuously while
the slider is being moved; you can make it emit the signal less
often by calling <a href="#setTracking">setTracking</a>(FALSE). <a href="#dialMoved">dialMoved</a>() is emitted
continuously even when <a href="#tracking">tracking</a>() is FALSE.
<p> The slider also emits <a href="#dialPressed">dialPressed</a>() and <a href="#dialReleased">dialReleased</a>() signals
when the mouse button is pressed and released. But note that the
dial's value can change without these signals being emitted; the
keyboard and wheel can be used to change the value.
<p> Unlike the slider, QDial attempts to draw a "nice" number of
notches rather than one per <a href="#lineStep">lineStep</a>(). If possible, the number
of notches drawn is one per lineStep(), but if there aren't enough
pixels to draw every one, QDial will draw every second, third
etc., notch. <a href="#notchSize">notchSize</a>() returns the number of units per notch,
hopefully a multiple of lineStep(); <a href="#setNotchTarget">setNotchTarget</a>() sets the
target distance between neighbouring notches in pixels. The
default is 3.75 pixels.
<p> Like the slider, the dial makes the <a href="qrangecontrol.html">QRangeControl</a> functions
<a href="#setValue">setValue</a>(), <a href="#addLine">addLine</a>(), <a href="#subtractLine">subtractLine</a>(), <a href="#addPage">addPage</a>() and
<a href="#subtractPage">subtractPage</a>() available as slots.
<p> The dial's keyboard interface is fairly simple: The left/up and
right/down arrow keys move by lineStep(), page up and page down by
<a href="#pageStep">pageStep</a>() and Home and End to <a href="#minValue">minValue</a>() and <a href="#maxValue">maxValue</a>().
<p> <img src=qdial-m.png> <img src=qdial-w.png>
<p> <p>See also <a href="qscrollbar.html">QScrollBar</a>, <a href="qspinbox.html">QSpinBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Slider</a>, and <a href="basic.html">Basic Widgets</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QDial"></a>QDial::QDial ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, WFlags f = 0 )
</h3>
Constructs a dial called <em>name</em> with parent <em>parent</em>. <em>f</em> is
propagated to the <a href="qwidget.html">QWidget</a> constructor. It has the default range of
a <a href="qrangecontrol.html">QRangeControl</a>.
<h3 class=fn><a name="QDial-2"></a>QDial::QDial ( int minValue, int maxValue, int pageStep, int value, <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )
</h3>
Constructs a dial called <em>name</em> with parent <em>parent</em>. The dial's
value can never be smaller than <em>minValue</em> or greater than <em>maxValue</em>. Its page step size is <em>pageStep</em>, and its initial value
is <em>value</em>.
<p> <em>value</em> is forced to be within the legal range.
<h3 class=fn><a name="~QDial"></a>QDial::~QDial ()
</h3>
Destroys the dial.
<h3 class=fn>void <a name="addLine"></a>QDial::addLine ()<tt> [slot]</tt>
</h3>
Increments the dial's <a href="#value">value</a>() by one <a href="#lineStep">lineStep</a>().
<h3 class=fn>void <a name="addPage"></a>QDial::addPage ()<tt> [slot]</tt>
</h3>
Increments the dial's <a href="#value">value</a>() by one <a href="#pageStep">pageStep</a>() of steps.
<h3 class=fn>void <a name="dialMoved"></a>QDial::dialMoved ( int value )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the dial <em>value</em> changes. The
frequency of this signal is <em>not</em> influenced by <a href="#setTracking">setTracking</a>().
<p> <p>See also <a href="#valueChanged">valueChanged</a>().
<h3 class=fn>void <a name="dialPressed"></a>QDial::dialPressed ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user begins mouse interaction with
the dial.
<p> <p>See also <a href="#dialReleased">dialReleased</a>().
<h3 class=fn>void <a name="dialReleased"></a>QDial::dialReleased ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the user ends mouse interaction with
the dial.
<p> <p>See also <a href="#dialPressed">dialPressed</a>().
<h3 class=fn>int <a name="lineStep"></a>QDial::lineStep () const
</h3><p>Returns the current line step.
See the <a href="qdial.html#lineStep-prop">"lineStep"</a> property for details.
<h3 class=fn>int <a name="maxValue"></a>QDial::maxValue () const
</h3><p>Returns the current maximum value.
See the <a href="qdial.html#maxValue-prop">"maxValue"</a> property for details.
<h3 class=fn>int <a name="minValue"></a>QDial::minValue () const
</h3><p>Returns the current minimum value.
See the <a href="qdial.html#minValue-prop">"minValue"</a> property for details.
<h3 class=fn>int <a name="notchSize"></a>QDial::notchSize () const
</h3><p>Returns the current notch size.
See the <a href="qdial.html#notchSize-prop">"notchSize"</a> property for details.
<h3 class=fn>double <a name="notchTarget"></a>QDial::notchTarget () const
</h3><p>Returns the target number of pixels between notches.
See the <a href="qdial.html#notchTarget-prop">"notchTarget"</a> property for details.
<h3 class=fn>bool <a name="notchesVisible"></a>QDial::notchesVisible () const
</h3><p>Returns TRUE if the notches are shown; otherwise returns FALSE.
See the <a href="qdial.html#notchesVisible-prop">"notchesVisible"</a> property for details.
<h3 class=fn>int <a name="pageStep"></a>QDial::pageStep () const
</h3><p>Returns the current page step.
See the <a href="qdial.html#pageStep-prop">"pageStep"</a> property for details.
<h3 class=fn>void <a name="rangeChange"></a>QDial::rangeChange ()<tt> [virtual protected]</tt>
</h3>
Reimplemented to ensure tick-marks are consistent with the new range.
<p>Reimplemented from <a href="qrangecontrol.html#rangeChange">QRangeControl</a>.
<h3 class=fn>void <a name="repaintScreen"></a>QDial::repaintScreen ( const <a href="qrect.html">QRect</a> * cr = 0 )<tt> [virtual protected]</tt>
</h3>
Paints the dial using clip region <em>cr</em>.
<h3 class=fn>void <a name="setLineStep"></a>QDial::setLineStep ( int )
</h3><p>Sets the current line step.
See the <a href="qdial.html#lineStep-prop">"lineStep"</a> property for details.
<h3 class=fn>void <a name="setMaxValue"></a>QDial::setMaxValue ( int )
</h3><p>Sets the current maximum value.
See the <a href="qdial.html#maxValue-prop">"maxValue"</a> property for details.
<h3 class=fn>void <a name="setMinValue"></a>QDial::setMinValue ( int )
</h3><p>Sets the current minimum value.
See the <a href="qdial.html#minValue-prop">"minValue"</a> property for details.
<h3 class=fn>void <a name="setNotchTarget"></a>QDial::setNotchTarget ( double )<tt> [virtual]</tt>
</h3><p>Sets the target number of pixels between notches.
See the <a href="qdial.html#notchTarget-prop">"notchTarget"</a> property for details.
<h3 class=fn>void <a name="setNotchesVisible"></a>QDial::setNotchesVisible ( bool b )<tt> [virtual slot]</tt>
</h3><p>Sets whether the notches are shown to <em>b</em>.
See the <a href="qdial.html#notchesVisible-prop">"notchesVisible"</a> property for details.
<h3 class=fn>void <a name="setPageStep"></a>QDial::setPageStep ( int )
</h3><p>Sets the current page step.
See the <a href="qdial.html#pageStep-prop">"pageStep"</a> property for details.
<h3 class=fn>void <a name="setTracking"></a>QDial::setTracking ( bool enable )<tt> [virtual slot]</tt>
</h3><p>Sets whether tracking is enabled to <em>enable</em>.
See the <a href="qdial.html#tracking-prop">"tracking"</a> property for details.
<h3 class=fn>void <a name="setValue"></a>QDial::setValue ( int )<tt> [virtual slot]</tt>
</h3><p>Sets the current dial value.
See the <a href="qdial.html#value-prop">"value"</a> property for details.
<h3 class=fn>void <a name="setWrapping"></a>QDial::setWrapping ( bool on )<tt> [virtual slot]</tt>
</h3><p>Sets whether wrapping is enabled to <em>on</em>.
See the <a href="qdial.html#wrapping-prop">"wrapping"</a> property for details.
<h3 class=fn>void <a name="subtractLine"></a>QDial::subtractLine ()<tt> [slot]</tt>
</h3>
Decrements the dial's <a href="#value">value</a>() by one <a href="#lineStep">lineStep</a>().
<h3 class=fn>void <a name="subtractPage"></a>QDial::subtractPage ()<tt> [slot]</tt>
</h3>
Decrements the dial's <a href="#value">value</a>() by one <a href="#pageStep">pageStep</a>() of steps.
<h3 class=fn>bool <a name="tracking"></a>QDial::tracking () const
</h3><p>Returns TRUE if tracking is enabled; otherwise returns FALSE.
See the <a href="qdial.html#tracking-prop">"tracking"</a> property for details.
<h3 class=fn>int <a name="value"></a>QDial::value () const
</h3><p>Returns the current dial value.
See the <a href="qdial.html#value-prop">"value"</a> property for details.
<h3 class=fn>void <a name="valueChange"></a>QDial::valueChange ()<tt> [virtual protected]</tt>
</h3>
Reimplemented to ensure the display is correct and to emit the
<a href="#valueChanged">valueChanged</a>(int) signal when appropriate.
<p>Reimplemented from <a href="qrangecontrol.html#valueChange">QRangeControl</a>.
<h3 class=fn>void <a name="valueChanged"></a>QDial::valueChanged ( int value )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the dial's <em>value</em> changes. The
frequency of this signal is influenced by <a href="#setTracking">setTracking</a>().
<h3 class=fn>bool <a name="wrapping"></a>QDial::wrapping () const
</h3><p>Returns TRUE if wrapping is enabled; otherwise returns FALSE.
See the <a href="qdial.html#wrapping-prop">"wrapping"</a> property for details.
<hr><h2>Property Documentation</h2>
<h3 class=fn>int <a name="lineStep-prop"></a>lineStep</h3>
<p>This property holds the current line step.
<p>setLineStep() calls the virtual <a href="qrangecontrol.html#stepChange">stepChange</a>() function if the new
line step is different from the previous setting.
<p> <p>See also <a href="qrangecontrol.html#setSteps">QRangeControl::setSteps</a>(), <a href="#pageStep-prop">pageStep</a>, and <a href="qrangecontrol.html#setRange">setRange</a>().
<p>Set this property's value with <a href="#setLineStep">setLineStep</a>() and get this property's value with <a href="#lineStep">lineStep</a>().
<h3 class=fn>int <a name="maxValue-prop"></a>maxValue</h3>
<p>This property holds the current maximum value.
<p>When setting this property, the <a href="#minValue-prop">QDial::minValue</a> is adjusted if
necessary to ensure that the range remains valid.
<p> <p>See also <a href="qrangecontrol.html#setRange">setRange</a>().
<p>Set this property's value with <a href="#setMaxValue">setMaxValue</a>() and get this property's value with <a href="#maxValue">maxValue</a>().
<h3 class=fn>int <a name="minValue-prop"></a>minValue</h3>
<p>This property holds the current minimum value.
<p>When setting this property, the <a href="#maxValue-prop">QDial::maxValue</a> is adjusted if
necessary to ensure that the range remains valid.
<p> <p>See also <a href="qrangecontrol.html#setRange">setRange</a>().
<p>Set this property's value with <a href="#setMinValue">setMinValue</a>() and get this property's value with <a href="#minValue">minValue</a>().
<h3 class=fn>int <a name="notchSize-prop"></a>notchSize</h3>
<p>This property holds the current notch size.
<p>The notch size is in range control units, not pixels, and if
possible it is a multiple of <a href="#lineStep">lineStep</a>() that results in an
on-screen notch size near <a href="#notchTarget">notchTarget</a>().
<p> <p>See also <a href="#notchTarget-prop">notchTarget</a> and <a href="#lineStep-prop">lineStep</a>.
<p>Get this property's value with <a href="#notchSize">notchSize</a>().
<h3 class=fn>double <a name="notchTarget-prop"></a>notchTarget</h3>
<p>This property holds the target number of pixels between notches.
<p>The notch target is the number of pixels QDial attempts to put
between each notch.
<p> The actual size may differ from the target size.
<p>Set this property's value with <a href="#setNotchTarget">setNotchTarget</a>() and get this property's value with <a href="#notchTarget">notchTarget</a>().
<h3 class=fn>bool <a name="notchesVisible-prop"></a>notchesVisible</h3>
<p>This property holds whether the notches are shown.
<p>If TRUE, the notches are shown. If FALSE (the default) notches are
not shown.
<p>Set this property's value with <a href="#setNotchesVisible">setNotchesVisible</a>() and get this property's value with <a href="#notchesVisible">notchesVisible</a>().
<h3 class=fn>int <a name="pageStep-prop"></a>pageStep</h3>
<p>This property holds the current page step.
<p>setPageStep() calls the virtual <a href="qrangecontrol.html#stepChange">stepChange</a>() function if the new
page step is different from the previous setting.
<p> <p>See also <a href="qrangecontrol.html#stepChange">stepChange</a>().
<p>Set this property's value with <a href="#setPageStep">setPageStep</a>() and get this property's value with <a href="#pageStep">pageStep</a>().
<h3 class=fn>bool <a name="tracking-prop"></a>tracking</h3>
<p>This property holds whether tracking is enabled.
<p>If TRUE (the default), tracking is enabled. This means that the
arrow can be moved using the mouse; otherwise the arrow cannot be
moved with the mouse.
<p>Set this property's value with <a href="#setTracking">setTracking</a>() and get this property's value with <a href="#tracking">tracking</a>().
<h3 class=fn>int <a name="value-prop"></a>value</h3>
<p>This property holds the current dial value.
<p>This is guaranteed to be within the range
<a href="#minValue-prop">QDial::minValue</a>..<a href="#maxValue-prop">QDial::maxValue</a>.
<p> <p>See also <a href="#minValue-prop">minValue</a> and <a href="#maxValue-prop">maxValue</a>.
<p>Set this property's value with <a href="#setValue">setValue</a>() and get this property's value with <a href="#value">value</a>().
<h3 class=fn>bool <a name="wrapping-prop"></a>wrapping</h3>
<p>This property holds whether wrapping is enabled.
<p>If TRUE, wrapping is enabled. This means that the arrow can be
turned around 360°. Otherwise there is some space at the bottom of
the dial which is skipped by the arrow.
<p> This property's default is FALSE.
<p>Set this property's value with <a href="#setWrapping">setWrapping</a>() and get this property's value with <a href="#wrapping">wrapping</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>
|