1QSlider(3qt) QSlider(3qt)
2
3
4
6 QSlider - Vertical or horizontal slider
7
9 #include <qslider.h>
10
11 Inherits QWidget and QRangeControl.
12
13 Public Members
14 enum TickSetting { NoMarks = 0, Above = 1, Left = Above, Below = 2,
15 Right = Below, Both = 3 }
16 QSlider ( QWidget * parent, const char * name = 0 )
17 QSlider ( Orientation orientation, QWidget * parent, const char * name
18 = 0 )
19 QSlider ( int minValue, int maxValue, int pageStep, int value,
20 Orientation orientation, QWidget * parent, const char * name = 0 )
21 ~QSlider ()
22 virtual void setOrientation ( Orientation )
23 Orientation orientation () const
24 virtual void setTracking ( bool enable )
25 bool tracking () const
26 virtual void setPalette ( const QPalette & p )
27 int sliderStart () const
28 QRect sliderRect () const
29 virtual void setTickmarks ( TickSetting )
30 TickSetting tickmarks () const
31 virtual void setTickInterval ( int )
32 int tickInterval () const
33 int minValue () const
34 int maxValue () const
35 void setMinValue ( int )
36 void setMaxValue ( int )
37 int lineStep () const
38 int pageStep () const
39 void setLineStep ( int )
40 void setPageStep ( int )
41 int value () const
42
43 Public Slots
44 virtual void setValue ( int )
45 void addStep ()
46 void subtractStep ()
47
48 Signals
49 void valueChanged ( int value )
50 void sliderPressed ()
51 void sliderMoved ( int value )
52 void sliderReleased ()
53
54 Important Inherited Members
55 void setRange ( int minValue, int maxValue )
56
57 Properties
58 int lineStep - the current line step
59 int maxValue - the current maximum value of the slider
60 int minValue - the current minimum value of the slider
61 Orientation orientation - the slider's orientation
62 int pageStep - the current page step
63 int tickInterval - the interval between tickmarks
64 TickSetting tickmarks - the tickmark settings for this slider
65 bool tracking - whether slider tracking is enabled
66 int value - the current slider value
67
68 Protected Members
69 virtual void valueChange ()
70 virtual void rangeChange ()
71
73 The QSlider widget provides a vertical or horizontal slider.
74
75 The slider is the classic widget for controlling a bounded value. It
76 lets the user move a slider along a horizontal or vertical groove and
77 translates the slider's position into an integer value within the legal
78 range.
79
80 QSlider inherits QRangeControl, which provides the "integer" side of
81 the slider. setRange() and value() are likely to be used by practically
82 all slider users; see the QRangeControl documentation for information
83 about the many other functions that class provides.
84
85 The main functions offered by the slider itself are tickmark and
86 orientation control; you can use setTickmarks() to indicate where you
87 want the tickmarks to be, setTickInterval() to indicate how many of
88 them you want and setOrientation() to indicate whether the slider is to
89 be horizontal or vertical.
90
91 A slider accepts focus on Tab and uses the mouse wheel and a suitable
92 keyboard interface.
93
94 [Image Omitted]
95
96 [Image Omitted]
97
98 See also QScrollBar, QSpinBox, GUI Design Handbook: Slider, and Basic
99 Widgets.
100
101 Member Type Documentation
103 This enum specifies where the tickmarks are to be drawn relative to the
104 slider's groove and the handle the user moves.
105
106 QSlider::NoMarks - do not draw any tickmarks.
107
108 QSlider::Both - draw tickmarks on both sides of the groove.
109
110 QSlider::Above - draw tickmarks above the (horizontal) slider
111
112 QSlider::Below - draw tickmarks below the (horizontal) slider
113
114 QSlider::Left - draw tickmarks to the left of the (vertical) slider
115
116 QSlider::Right - draw tickmarks to the right of the (vertical) slider
117
120 Constructs a vertical slider.
121
122 The parent and name arguments are sent on to the QWidget constructor.
123
125 name = 0 )
126 Constructs a slider.
127
128 The orientation must be Qt::Vertical or Qt::Horizontal.
129
130 The parent and name arguments are sent on to the QWidget constructor.
131
133 Orientation orientation, QWidget * parent, const char * name = 0 )
134 Constructs a slider whose value can never be smaller than minValue or
135 greater than maxValue, whose page step size is pageStep and whose value
136 is initially value (which is guaranteed to be in range using bound()).
137
138 If orientation is Qt::Vertical the slider is vertical and if it is
139 Qt::Horizontal the slider is horizontal.
140
141 The parent and name arguments are sent on to the QWidget constructor.
142
144 Destructor.
145
147 Moves the slider one pageStep() up or right.
148
150 Returns the current line step. See the "lineStep" property for details.
151
153 Returns the current maximum value of the slider. See the "maxValue"
154 property for details.
155
157 Returns the current minimum value of the slider. See the "minValue"
158 property for details.
159
161 Returns the slider's orientation. See the "orientation" property for
162 details.
163
165 Returns the current page step. See the "pageStep" property for details.
166
168 Implements the virtual QRangeControl function.
169
170 Reimplemented from QRangeControl.
171
173 Sets the current line step. See the "lineStep" property for details.
174
176 Sets the current maximum value of the slider. See the "maxValue"
177 property for details.
178
180 Sets the current minimum value of the slider. See the "minValue"
181 property for details.
182
184 Sets the slider's orientation. See the "orientation" property for
185 details.
186
188 Sets the current page step. See the "pageStep" property for details.
189
191 Reimplements the virtual function QWidget::setPalette().
192
193 Sets the background color to the mid color for Motif style sliders
194 using palette p.
195
196 Reimplemented from QWidget.
197
199 Sets the range control's minimum value to minValue and its maximum
200 value to maxValue.
201
202 Calls the virtual rangeChange() function if one or both of the new
203 minimum and maximum values are different from the previous setting.
204 Calls the virtual valueChange() function if the current value is
205 adjusted because it was outside the new range.
206
207 If maxValue is smaller than minValue, minValue becomes the only legal
208 value.
209
210 See also minValue and maxValue.
211
212 Examples:
213
215 Sets the interval between tickmarks. See the "tickInterval" property
216 for details.
217
219 Sets the tickmark settings for this slider. See the "tickmarks"
220 property for details.
221
223 Sets whether slider tracking is enabled to enable. See the "tracking"
224 property for details.
225
227 Sets the current slider value. See the "value" property for details.
228
230 This signal is emitted when the slider is dragged, with the new slider
231 value as its argument.
232
234 This signal is emitted when the user presses the slider with the mouse.
235
237 Returns the slider handle rectangle. (This is the visual marker that
238 the user can move.)
239
241 This signal is emitted when the user releases the slider with the
242 mouse.
243
245 Returns the start position of the slider.
246
248 Moves the slider one pageStep() down or left.
249
251 Returns the interval between tickmarks. See the "tickInterval" property
252 for details.
253
255 Returns the tickmark settings for this slider. See the "tickmarks"
256 property for details.
257
259 Returns TRUE if slider tracking is enabled; otherwise returns FALSE.
260 See the "tracking" property for details.
261
263 Returns the current slider value. See the "value" property for details.
264
266 Implements the virtual QRangeControl function.
267
268 Reimplemented from QRangeControl.
269
271 This signal is emitted when the slider value is changed, with the new
272 slider value as its argument.
273
274 Examples:
275
276 Property Documentation
278 This property holds the current line step.
279
280 When setting lineStep, the virtual stepChange() function will be called
281 if the new line step is different from the previous setting.
282
283 See also setSteps(), QRangeControl::pageStep(), and setRange().
284
285 Set this property's value with setLineStep() and get this property's
286 value with lineStep().
287
289 This property holds the current maximum value of the slider.
290
291 When setting this property, the QSlider::minValue is adjusted, if
292 necessary, to ensure that the range remains valid.
293
294 See also setRange().
295
296 Set this property's value with setMaxValue() and get this property's
297 value with maxValue().
298
300 This property holds the current minimum value of the slider.
301
302 When setting this property, the QSlider::maxValue is adjusted, if
303 necessary, to ensure that the range remains valid.
304
305 See also setRange().
306
307 Set this property's value with setMinValue() and get this property's
308 value with minValue().
309
311 This property holds the slider's orientation.
312
313 The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
314
315 Set this property's value with setOrientation() and get this property's
316 value with orientation().
317
319 This property holds the current page step.
320
321 When setting pageStep, the virtual stepChange() function will be called
322 if the new page step is different from the previous setting.
323
324 See also QRangeControl::setSteps(), lineStep, and setRange().
325
326 Set this property's value with setPageStep() and get this property's
327 value with pageStep().
328
330 This property holds the interval between tickmarks.
331
332 This is a value interval, not a pixel interval. If it is 0, the slider
333 will choose between lineStep() and pageStep(). The initial value of
334 tickInterval is 0.
335
336 See also QRangeControl::lineStep() and QRangeControl::pageStep().
337
338 Set this property's value with setTickInterval() and get this
339 property's value with tickInterval().
340
342 This property holds the tickmark settings for this slider.
343
344 The valid values are in QSlider::TickSetting. The default is NoMarks.
345
346 See also tickInterval.
347
348 Set this property's value with setTickmarks() and get this property's
349 value with tickmarks().
350
352 This property holds whether slider tracking is enabled.
353
354 If tracking is enabled (the default), the slider emits the
355 valueChanged() signal whenever the slider is being dragged. If tracking
356 is disabled, the slider emits the valueChanged() signal when the user
357 releases the mouse button (unless the value happens to be the same as
358 before).
359
360 Set this property's value with setTracking() and get this property's
361 value with tracking().
362
364 This property holds the current slider value.
365
366 Set this property's value with setValue() and get this property's value
367 with value().
368
369 See also QRangeControl::value() and prevValue().
370
371
373 http://doc.trolltech.com/qslider.html
374 http://www.trolltech.com/faq/tech.html
375
377 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
378 license file included in the distribution for a complete license
379 statement.
380
382 Generated automatically from the source code.
383
385 If you find a bug in Qt, please report it as described in
386 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
387 help you. Thank you.
388
389 The definitive Qt documentation is provided in HTML format; it is
390 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
391 web browser. This man page is provided as a convenience for those users
392 who prefer man pages, although this format is not officially supported
393 by Trolltech.
394
395 If you find errors in this manual page, please report them to qt-
396 bugs@trolltech.com. Please include the name of the manual page
397 (qslider.3qt) and the Qt version (3.3.8).
398
399
400
401Trolltech AS 2 February 2007 QSlider(3qt)