File: q3rangecontrol.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (266 lines) | stat: -rw-r--r-- 28,456 bytes parent folder | download
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- q3rangecontrol.cpp -->
  <title>Qt 4.8: Q3RangeControl Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li>Qt3SupportLight</li>
<li>Q3RangeControl</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">Q3RangeControl Class Reference</h1>
<!-- $$$Q3RangeControl-brief -->
<p>The Q3RangeControl class provides an integer value within a range. <a href="#details">More...</a></p>
<!-- @@@Q3RangeControl -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Q3RangeControl&gt;</span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qrangecontrol">Porting to Qt 4</a> for more information.</p>
<ul>
<li><a href="q3rangecontrol-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#Q3RangeControl">Q3RangeControl</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#Q3RangeControl-2">Q3RangeControl</a></b> ( int <i>minValue</i>, int <i>maxValue</i>, int <i>lineStep</i>, int <i>pageStep</i>, int <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#dtor.Q3RangeControl">~Q3RangeControl</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#addLine">addLine</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#addPage">addPage</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#bound">bound</a></b> ( int <i>v</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#lineStepx">lineStep</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#maxValue">maxValue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#minValue">minValue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#pageStep">pageStep</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#setMaxValue">setMaxValue</a></b> ( int <i>maxVal</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#setMinValue">setMinValue</a></b> ( int <i>minVal</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#setRange">setRange</a></b> ( int <i>minValue</i>, int <i>maxValue</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#setSteps">setSteps</a></b> ( int <i>lineStep</i>, int <i>pageStep</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#setValue">setValue</a></b> ( int <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#subtractLine">subtractLine</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#subtractPage">subtractPage</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#value">value</a></b> () const</td></tr>
</table>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#directSetValue">directSetValue</a></b> ( int <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#positionFromValue">positionFromValue</a></b> ( int <i>logical_val</i>, int <i>span</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#prevValue">prevValue</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#rangeChange">rangeChange</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#stepChange">stepChange</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#valueChange">valueChange</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="q3rangecontrol.html#valueFromPosition">valueFromPosition</a></b> ( int <i>pos</i>, int <i>span</i> ) const</td></tr>
</table>
<a name="details"></a>
<!-- $$$Q3RangeControl-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3RangeControl class provides an integer value within a range.</p>
<p>Although originally designed for the <a href="qscrollbar.html">QScrollBar</a> widget, the Q3RangeControl can also be used in conjunction with other widgets such as <a href="qslider.html">QSlider</a> and <a href="qspinbox.html">QSpinBox</a>. Here are the five main concepts in the class:</p>
<ol class="1">
<li><i>Current value</i> The bounded integer that Q3RangeControl maintains. <a href="q3rangecontrol.html#value">value</a>() returns it, and several functions, including <a href="q3rangecontrol.html#setValue">setValue</a>(), set it.</li>
<li><i>Minimum</i> The lowest value that <a href="q3rangecontrol.html#value">value</a>() can ever return. Returned by <a href="q3rangecontrol.html#minValue">minValue</a>() and set by <a href="q3rangecontrol.html#setRange">setRange</a>() or one of the constructors.</li>
<li><i>Maximum</i> The highest value that <a href="q3rangecontrol.html#value">value</a>() can ever return. Returned by <a href="q3rangecontrol.html#maxValue">maxValue</a>() and set by <a href="q3rangecontrol.html#setRange">setRange</a>() or one of the constructors.</li>
<li><i>Line step</i> The smaller of two natural steps that Q3RangeControl provides and typically corresponds to the user pressing an arrow key. The line step is returned by <a href="q3rangecontrol.html#lineStepx">lineStep</a>() and set using <a href="q3rangecontrol.html#setSteps">setSteps</a>(). The functions <a href="q3rangecontrol.html#addLine">addLine</a>() and <a href="q3rangecontrol.html#subtractLine">subtractLine</a>() respectively increment and decrement the current value by <a href="q3rangecontrol.html#lineStepx">lineStep</a>().</li>
<li><i>Page step</i> The larger of two natural steps that Q3RangeControl provides and typically corresponds to the user pressing PageUp or PageDown. The page step is returned by <a href="q3rangecontrol.html#pageStep">pageStep</a>() and set using <a href="q3rangecontrol.html#setSteps">setSteps</a>(). The functions <a href="q3rangecontrol.html#addPage">addPage</a>() and substractPage() respectively increment and decrement the current value by <a href="q3rangecontrol.html#pageStep">pageStep</a>().</li>
</ol>
<p>Unity (1) may be viewed as a third step size. <a href="q3rangecontrol.html#setValue">setValue</a>() lets you set the current value to any integer in the allowed range, not just <a href="q3rangecontrol.html#minValue">minValue</a>() + <i>n</i> * <a href="q3rangecontrol.html#lineStepx">lineStep</a>() for integer values of <i>n</i>. Some widgets may allow the user to set any value at all; others may just provide multiples of <a href="q3rangecontrol.html#lineStepx">lineStep</a>() or <a href="q3rangecontrol.html#pageStep">pageStep</a>().</p>
<p>Q3RangeControl provides three virtual functions that are well suited for updating the on-screen representation of range controls and emitting signals: <a href="q3rangecontrol.html#valueChange">valueChange</a>(), <a href="q3rangecontrol.html#rangeChange">rangeChange</a>() and <a href="q3rangecontrol.html#stepChange">stepChange</a>().</p>
<p>Q3RangeControl also provides a function called <a href="q3rangecontrol.html#bound">bound</a>() which lets you force arbitrary integers to be within the allowed range of the range control.</p>
<p>We recommend that all widgets that inherit Q3RangeControl provide at least a signal called valueChanged(); many widgets will want to provide addStep(), <a href="q3rangecontrol.html#addPage">addPage</a>(), substractStep() and substractPage() as slots.</p>
<p>Note that you must use multiple inheritance if you plan to implement a widget using Q3RangeControl because Q3RangeControl is not derived from <a href="qwidget.html">QWidget</a>.</p>
</div>
<!-- @@@Q3RangeControl -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3RangeControl[overload1]$$$Q3RangeControl -->
<h3 class="fn"><a name="Q3RangeControl"></a>Q3RangeControl::<span class="name">Q3RangeControl</span> ()</h3>
<p>Constructs a range control with a minimum value of 0, maximum value of 99, line step of 1, page step of 10 and initial value 0.</p>
<!-- @@@Q3RangeControl -->
<!-- $$$Q3RangeControl$$$Q3RangeControlintintintintint -->
<h3 class="fn"><a name="Q3RangeControl-2"></a>Q3RangeControl::<span class="name">Q3RangeControl</span> ( <span class="type">int</span> <i>minValue</i>, <span class="type">int</span> <i>maxValue</i>, <span class="type">int</span> <i>lineStep</i>, <span class="type">int</span> <i>pageStep</i>, <span class="type">int</span> <i>value</i> )</h3>
<p>Constructs a range control whose value can never be smaller than <i>minValue</i> or greater than <i>maxValue</i>, whose line step size is <i>lineStep</i> and page step size is <i>pageStep</i> and whose value is initially <i>value</i> (which is guaranteed to be in range using <a href="q3rangecontrol.html#bound">bound</a>()).</p>
<!-- @@@Q3RangeControl -->
<!-- $$$~Q3RangeControl[overload1]$$$~Q3RangeControl -->
<h3 class="fn"><a name="dtor.Q3RangeControl"></a>Q3RangeControl::<span class="name">~Q3RangeControl</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the range control</p>
<!-- @@@~Q3RangeControl -->
<!-- $$$addLine[overload1]$$$addLine -->
<h3 class="fn"><a name="addLine"></a><span class="type">void</span> Q3RangeControl::<span class="name">addLine</span> ()</h3>
<p>Equivalent to <tt>setValue(value() + lineStep())</tt>.</p>
<p>If the value is changed, then <a href="q3rangecontrol.html#valueChange">valueChange</a>() is called.</p>
<p><b>See also </b><a href="q3rangecontrol.html#subtractLine">subtractLine</a>(), <a href="q3rangecontrol.html#addPage">addPage</a>(), and <a href="q3rangecontrol.html#setValue">setValue</a>().</p>
<!-- @@@addLine -->
<!-- $$$addPage[overload1]$$$addPage -->
<h3 class="fn"><a name="addPage"></a><span class="type">void</span> Q3RangeControl::<span class="name">addPage</span> ()</h3>
<p>Equivalent to <tt>setValue(value() + pageStep())</tt>.</p>
<p>If the value is changed, then <a href="q3rangecontrol.html#valueChange">valueChange</a>() is called.</p>
<p><b>See also </b><a href="q3rangecontrol.html#subtractPage">subtractPage</a>(), <a href="q3rangecontrol.html#addLine">addLine</a>(), and <a href="q3rangecontrol.html#setValue">setValue</a>().</p>
<!-- @@@addPage -->
<!-- $$$bound[overload1]$$$boundint -->
<h3 class="fn"><a name="bound"></a><span class="type">int</span> Q3RangeControl::<span class="name">bound</span> ( <span class="type">int</span> <i>v</i> ) const</h3>
<p>Forces the value <i>v</i> to be within the range from <a href="q3rangecontrol.html#minValue">minValue</a>() to <a href="q3rangecontrol.html#maxValue">maxValue</a>() inclusive, and returns the result.</p>
<p>This function is provided so that you can easily force other numbers than <a href="q3rangecontrol.html#value">value</a>() into the allowed range. You do not need to call it in order to use <a href="q3rangecontrol.html" class="compat">Q3RangeControl</a> itself.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setValue">setValue</a>(), <a href="q3rangecontrol.html#value">value</a>(), <a href="q3rangecontrol.html#minValue">minValue</a>(), and <a href="q3rangecontrol.html#maxValue">maxValue</a>().</p>
<!-- @@@bound -->
<!-- $$$directSetValue[overload1]$$$directSetValueint -->
<h3 class="fn"><a name="directSetValue"></a><span class="type">void</span> Q3RangeControl::<span class="name">directSetValue</span> ( <span class="type">int</span> <i>value</i> )<tt> [protected]</tt></h3>
<p>Sets the range control <i>value</i> directly without calling <a href="q3rangecontrol.html#valueChange">valueChange</a>().</p>
<p>Forces the new <i>value</i> to be within the legal range.</p>
<p>You will rarely have to call this function. However, if you want to change the range control's value inside the overloaded method <a href="q3rangecontrol.html#valueChange">valueChange</a>(), <a href="q3rangecontrol.html#setValue">setValue</a>() would call the function <a href="q3rangecontrol.html#valueChange">valueChange</a>() again. To avoid this recursion you must use directSetValue() instead.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setValue">setValue</a>().</p>
<!-- @@@directSetValue -->
<!-- $$$lineStep[overload1]$$$lineStep -->
<h3 class="fn"><a name="lineStepx"></a><span class="type">int</span> Q3RangeControl::<span class="name">lineStep</span> () const</h3>
<p>Returns the line step.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setSteps">setSteps</a>() and <a href="q3rangecontrol.html#pageStep">pageStep</a>().</p>
<!-- @@@lineStep -->
<!-- $$$maxValue[overload1]$$$maxValue -->
<h3 class="fn"><a name="maxValue"></a><span class="type">int</span> Q3RangeControl::<span class="name">maxValue</span> () const</h3>
<p>Returns the maximum value of the range.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setMaxValue">setMaxValue</a>(), <a href="q3rangecontrol.html#setRange">setRange</a>(), and <a href="q3rangecontrol.html#minValue">minValue</a>().</p>
<!-- @@@maxValue -->
<!-- $$$minValue[overload1]$$$minValue -->
<h3 class="fn"><a name="minValue"></a><span class="type">int</span> Q3RangeControl::<span class="name">minValue</span> () const</h3>
<p>Returns the minimum value of the range.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setMinValue">setMinValue</a>(), <a href="q3rangecontrol.html#setRange">setRange</a>(), and <a href="q3rangecontrol.html#maxValue">maxValue</a>().</p>
<!-- @@@minValue -->
<!-- $$$pageStep[overload1]$$$pageStep -->
<h3 class="fn"><a name="pageStep"></a><span class="type">int</span> Q3RangeControl::<span class="name">pageStep</span> () const</h3>
<p>Returns the page step.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setSteps">setSteps</a>() and <a href="q3rangecontrol.html#lineStepx">lineStep</a>().</p>
<!-- @@@pageStep -->
<!-- $$$positionFromValue[overload1]$$$positionFromValueintint -->
<h3 class="fn"><a name="positionFromValue"></a><span class="type">int</span> Q3RangeControl::<span class="name">positionFromValue</span> ( <span class="type">int</span> <i>logical_val</i>, <span class="type">int</span> <i>span</i> ) const<tt> [protected]</tt></h3>
<p>Converts <i>logical_val</i> to a pixel position. <a href="q3rangecontrol.html#minValue">minValue</a>() maps to 0, <a href="q3rangecontrol.html#maxValue">maxValue</a>() maps to <i>span</i> and other values are distributed evenly in-between.</p>
<p>This function can handle the entire integer range without overflow, providing <i>span</i> is &lt;= 4096.</p>
<p>Calling this method is useful when actually drawing a range control such as a <a href="qscrollbar.html">QScrollBar</a> on-screen.</p>
<p><b>See also </b><a href="q3rangecontrol.html#valueFromPosition">valueFromPosition</a>().</p>
<!-- @@@positionFromValue -->
<!-- $$$prevValue[overload1]$$$prevValue -->
<h3 class="fn"><a name="prevValue"></a><span class="type">int</span> Q3RangeControl::<span class="name">prevValue</span> () const<tt> [protected]</tt></h3>
<p>Returns the previous value of the range control. &quot;Previous value&quot; means the value before the last change occurred. Setting a new range may affect the value, too, because the value is forced to be inside the specified range. When the range control is initially created, this is the same as <a href="q3rangecontrol.html#value">value</a>().</p>
<p>prevValue() can be outside the current legal range if a call to <a href="q3rangecontrol.html#setRange">setRange</a>() causes the current value to change. For example, if the range was [0, 1000] and the current value is 500, setRange(0, 400) makes <a href="q3rangecontrol.html#value">value</a>() return 400 and prevValue() return 500.</p>
<p><b>See also </b><a href="q3rangecontrol.html#value">value</a>() and <a href="q3rangecontrol.html#setRange">setRange</a>().</p>
<!-- @@@prevValue -->
<!-- $$$rangeChange[overload1]$$$rangeChange -->
<h3 class="fn"><a name="rangeChange"></a><span class="type">void</span> Q3RangeControl::<span class="name">rangeChange</span> ()<tt> [virtual protected]</tt></h3>
<p>This virtual function is called whenever the range control's range changes. You can reimplement it if you want to be notified when the range changes. The default implementation does nothing.</p>
<p>Note that this method is called after the range has changed.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setRange">setRange</a>(), <a href="q3rangecontrol.html#valueChange">valueChange</a>(), and <a href="q3rangecontrol.html#stepChange">stepChange</a>().</p>
<!-- @@@rangeChange -->
<!-- $$$setMaxValue[overload1]$$$setMaxValueint -->
<h3 class="fn"><a name="setMaxValue"></a><span class="type">void</span> Q3RangeControl::<span class="name">setMaxValue</span> ( <span class="type">int</span> <i>maxVal</i> )</h3>
<p>Sets the minimum value of the range to <i>maxVal</i>.</p>
<p>If necessary, the <a href="q3rangecontrol.html#minValue">minValue</a>() is adjusted so that the range remains valid.</p>
<p><b>See also </b><a href="q3rangecontrol.html#maxValue">maxValue</a>() and <a href="q3rangecontrol.html#setMinValue">setMinValue</a>().</p>
<!-- @@@setMaxValue -->
<!-- $$$setMinValue[overload1]$$$setMinValueint -->
<h3 class="fn"><a name="setMinValue"></a><span class="type">void</span> Q3RangeControl::<span class="name">setMinValue</span> ( <span class="type">int</span> <i>minVal</i> )</h3>
<p>Sets the minimum value of the range to <i>minVal</i>.</p>
<p>If necessary, the <a href="q3rangecontrol.html#maxValue">maxValue</a>() is adjusted so that the range remains valid.</p>
<p><b>See also </b><a href="q3rangecontrol.html#minValue">minValue</a>() and <a href="q3rangecontrol.html#setMaxValue">setMaxValue</a>().</p>
<!-- @@@setMinValue -->
<!-- $$$setRange[overload1]$$$setRangeintint -->
<h3 class="fn"><a name="setRange"></a><span class="type">void</span> Q3RangeControl::<span class="name">setRange</span> ( <span class="type">int</span> <i>minValue</i>, <span class="type">int</span> <i>maxValue</i> )</h3>
<p>Sets the range control's minimum value to <i>minValue</i> and its maximum value to <i>maxValue</i>.</p>
<p>Calls the virtual <a href="q3rangecontrol.html#rangeChange">rangeChange</a>() function if one or both of the new minimum and maximum values are different from the previous setting. Calls the virtual <a href="q3rangecontrol.html#valueChange">valueChange</a>() function if the current value is adjusted because it was outside the new range.</p>
<p>If <i>maxValue</i> is smaller than <i>minValue</i>, <i>minValue</i> becomes the only legal value.</p>
<p><b>See also </b><a href="q3rangecontrol.html#minValue">minValue</a>() and <a href="q3rangecontrol.html#maxValue">maxValue</a>().</p>
<!-- @@@setRange -->
<!-- $$$setSteps[overload1]$$$setStepsintint -->
<h3 class="fn"><a name="setSteps"></a><span class="type">void</span> Q3RangeControl::<span class="name">setSteps</span> ( <span class="type">int</span> <i>lineStep</i>, <span class="type">int</span> <i>pageStep</i> )</h3>
<p>Sets the range's line step to <i>lineStep</i> and page step to <i>pageStep</i>.</p>
<p>Calls the virtual <a href="q3rangecontrol.html#stepChange">stepChange</a>() function if the new line step or page step are different from the previous settings.</p>
<p><b>See also </b><a href="q3rangecontrol.html#lineStepx">lineStep</a>(), <a href="q3rangecontrol.html#pageStep">pageStep</a>(), and <a href="q3rangecontrol.html#setRange">setRange</a>().</p>
<!-- @@@setSteps -->
<!-- $$$setValue[overload1]$$$setValueint -->
<h3 class="fn"><a name="setValue"></a><span class="type">void</span> Q3RangeControl::<span class="name">setValue</span> ( <span class="type">int</span> <i>value</i> )</h3>
<p>Sets the range control's value to <i>value</i> and forces it to be within the legal range.</p>
<p>Calls the virtual <a href="q3rangecontrol.html#valueChange">valueChange</a>() function if the new value is different from the previous value. The old value can still be retrieved using <a href="q3rangecontrol.html#prevValue">prevValue</a>().</p>
<p><b>See also </b><a href="q3rangecontrol.html#value">value</a>().</p>
<!-- @@@setValue -->
<!-- $$$stepChange[overload1]$$$stepChange -->
<h3 class="fn"><a name="stepChange"></a><span class="type">void</span> Q3RangeControl::<span class="name">stepChange</span> ()<tt> [virtual protected]</tt></h3>
<p>This virtual function is called whenever the range control's line or page step settings change. You can reimplement it if you want to be notified when the step changes. The default implementation does nothing.</p>
<p>Note that this method is called after a step setting has changed.</p>
<p><b>See also </b><a href="q3rangecontrol.html#setSteps">setSteps</a>(), <a href="q3rangecontrol.html#rangeChange">rangeChange</a>(), and <a href="q3rangecontrol.html#valueChange">valueChange</a>().</p>
<!-- @@@stepChange -->
<!-- $$$subtractLine[overload1]$$$subtractLine -->
<h3 class="fn"><a name="subtractLine"></a><span class="type">void</span> Q3RangeControl::<span class="name">subtractLine</span> ()</h3>
<p>Equivalent to <tt>setValue(value() - lineStep())</tt>.</p>
<p>If the value is changed, then <a href="q3rangecontrol.html#valueChange">valueChange</a>() is called.</p>
<p><b>See also </b><a href="q3rangecontrol.html#addLine">addLine</a>(), <a href="q3rangecontrol.html#subtractPage">subtractPage</a>(), and <a href="q3rangecontrol.html#setValue">setValue</a>().</p>
<!-- @@@subtractLine -->
<!-- $$$subtractPage[overload1]$$$subtractPage -->
<h3 class="fn"><a name="subtractPage"></a><span class="type">void</span> Q3RangeControl::<span class="name">subtractPage</span> ()</h3>
<p>Equivalent to <tt>setValue(value() - pageStep())</tt>.</p>
<p>If the value is changed, then <a href="q3rangecontrol.html#valueChange">valueChange</a>() is called.</p>
<p><b>See also </b><a href="q3rangecontrol.html#addPage">addPage</a>(), <a href="q3rangecontrol.html#subtractLine">subtractLine</a>(), and <a href="q3rangecontrol.html#setValue">setValue</a>().</p>
<!-- @@@subtractPage -->
<!-- $$$value[overload1]$$$value -->
<h3 class="fn"><a name="value"></a><span class="type">int</span> Q3RangeControl::<span class="name">value</span> () const</h3>
<p>Returns the current range control value. This is guaranteed to be within the range [<a href="q3rangecontrol.html#minValue">minValue</a>(), <a href="q3rangecontrol.html#maxValue">maxValue</a>()].</p>
<p><b>See also </b><a href="q3rangecontrol.html#setValue">setValue</a>() and <a href="q3rangecontrol.html#prevValue">prevValue</a>().</p>
<!-- @@@value -->
<!-- $$$valueChange[overload1]$$$valueChange -->
<h3 class="fn"><a name="valueChange"></a><span class="type">void</span> Q3RangeControl::<span class="name">valueChange</span> ()<tt> [virtual protected]</tt></h3>
<p>This virtual function is called whenever the range control value changes. You can reimplement it if you want to be notified when the value changes. The default implementation does nothing.</p>
<p>Note that this method is called after the value has changed. The previous value can be retrieved using <a href="q3rangecontrol.html#prevValue">prevValue</a>().</p>
<p><b>See also </b><a href="q3rangecontrol.html#setValue">setValue</a>(), <a href="q3rangecontrol.html#addPage">addPage</a>(), <a href="q3rangecontrol.html#subtractPage">subtractPage</a>(), <a href="q3rangecontrol.html#addLine">addLine</a>(), <a href="q3rangecontrol.html#subtractLine">subtractLine</a>(), <a href="q3rangecontrol.html#rangeChange">rangeChange</a>(), and <a href="q3rangecontrol.html#stepChange">stepChange</a>().</p>
<!-- @@@valueChange -->
<!-- $$$valueFromPosition[overload1]$$$valueFromPositionintint -->
<h3 class="fn"><a name="valueFromPosition"></a><span class="type">int</span> Q3RangeControl::<span class="name">valueFromPosition</span> ( <span class="type">int</span> <i>pos</i>, <span class="type">int</span> <i>span</i> ) const<tt> [protected]</tt></h3>
<p>Converts the pixel position <i>pos</i> to a value. 0 maps to <a href="q3rangecontrol.html#minValue">minValue</a>(), <i>span</i> maps to <a href="q3rangecontrol.html#maxValue">maxValue</a>() and other values are distributed evenly in-between.</p>
<p>This function can handle the entire integer range without overflow.</p>
<p>Calling this method is useful if you actually implemented a range control widget such as <a href="qscrollbar.html">QScrollBar</a> and want to handle mouse press events. This function then maps screen coordinates to the logical values.</p>
<p><b>See also </b><a href="q3rangecontrol.html#positionFromValue">positionFromValue</a>().</p>
<!-- @@@valueFromPosition -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>