summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqslider.3qt
blob: 65b0e6ce56e2b467d44a2bc7eeeeeae6f38c6158 (plain)
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
'\" t
.TH QSlider 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QSlider \- Vertical or horizontal slider
.SH SYNOPSIS
\fC#include <ntqslider.h>\fR
.PP
Inherits QWidget and QRangeControl.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "enum \fBTickSetting\fR { NoMarks = 0, Above = 1, Left = Above, Below = 2, Right = Below, Both = 3 }"
.br
.ti -1c
.BI "\fBQSlider\fR ( QWidget * parent, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQSlider\fR ( Orientation orientation, QWidget * parent, const char * name = 0 )"
.br
.ti -1c
.BI "\fBQSlider\fR ( int minValue, int maxValue, int pageStep, int value, Orientation orientation, QWidget * parent, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~QSlider\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetOrientation\fR ( Orientation )"
.br
.ti -1c
.BI "Orientation \fBorientation\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetTracking\fR ( bool enable )"
.br
.ti -1c
.BI "bool \fBtracking\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetPalette\fR ( const QPalette & p )"
.br
.ti -1c
.BI "int \fBsliderStart\fR () const"
.br
.ti -1c
.BI "QRect \fBsliderRect\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetTickmarks\fR ( TickSetting )"
.br
.ti -1c
.BI "TickSetting \fBtickmarks\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetTickInterval\fR ( int )"
.br
.ti -1c
.BI "int \fBtickInterval\fR () const"
.br
.ti -1c
.BI "int \fBminValue\fR () const"
.br
.ti -1c
.BI "int \fBmaxValue\fR () const"
.br
.ti -1c
.BI "void \fBsetMinValue\fR ( int )"
.br
.ti -1c
.BI "void \fBsetMaxValue\fR ( int )"
.br
.ti -1c
.BI "int \fBlineStep\fR () const"
.br
.ti -1c
.BI "int \fBpageStep\fR () const"
.br
.ti -1c
.BI "void \fBsetLineStep\fR ( int )"
.br
.ti -1c
.BI "void \fBsetPageStep\fR ( int )"
.br
.ti -1c
.BI "int \fBvalue\fR () const"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "virtual void \fBsetValue\fR ( int )"
.br
.ti -1c
.BI "void \fBaddStep\fR ()"
.br
.ti -1c
.BI "void \fBsubtractStep\fR ()"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBvalueChanged\fR ( int value )"
.br
.ti -1c
.BI "void \fBsliderPressed\fR ()"
.br
.ti -1c
.BI "void \fBsliderMoved\fR ( int value )"
.br
.ti -1c
.BI "void \fBsliderReleased\fR ()"
.br
.in -1c
.SS "Important Inherited Members"
.in +1c
.ti -1c
.BI "void \fBsetRange\fR ( int minValue, int maxValue )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "int \fBlineStep\fR - the current line step"
.br
.ti -1c
.BI "int \fBmaxValue\fR - the current maximum value of the slider"
.br
.ti -1c
.BI "int \fBminValue\fR - the current minimum value of the slider"
.br
.ti -1c
.BI "Orientation \fBorientation\fR - the slider's orientation"
.br
.ti -1c
.BI "int \fBpageStep\fR - the current page step"
.br
.ti -1c
.BI "int \fBtickInterval\fR - the interval between tickmarks"
.br
.ti -1c
.BI "TickSetting \fBtickmarks\fR - the tickmark settings for this slider"
.br
.ti -1c
.BI "bool \fBtracking\fR - whether slider tracking is enabled"
.br
.ti -1c
.BI "int \fBvalue\fR - the current slider value"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBvalueChange\fR ()"
.br
.ti -1c
.BI "virtual void \fBrangeChange\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QSlider widget provides a vertical or horizontal slider.
.PP
The slider is the classic widget for controlling a bounded value. It lets the user move a slider along a horizontal or vertical groove and translates the slider's position into an integer value within the legal range.
.PP
QSlider inherits QRangeControl, which provides the "integer" side of the slider. setRange() and value() are likely to be used by practically all slider users; see the QRangeControl documentation for information about the many other functions that class provides.
.PP
The main functions offered by the slider itself are tickmark and orientation control; you can use setTickmarks() to indicate where you want the tickmarks to be, setTickInterval() to indicate how many of them you want and setOrientation() to indicate whether the slider is to be horizontal or vertical.
.PP
A slider accepts focus on Tab and uses the mouse wheel and a suitable keyboard interface.
.PP
.ce 1
.B "[Image Omitted]"
.PP

.ce 1
.B "[Image Omitted]"
.PP
See also QScrollBar, QSpinBox, GUI Design Handbook: Slider, and Basic Widgets.
.SS "Member Type Documentation"
.SH "QSlider::TickSetting"
This enum specifies where the tickmarks are to be drawn relative to the slider's groove and the handle the user moves.
.TP
\fCQSlider::NoMarks\fR - do not draw any tickmarks.
.TP
\fCQSlider::Both\fR - draw tickmarks on both sides of the groove.
.TP
\fCQSlider::Above\fR - draw tickmarks above the (horizontal) slider
.TP
\fCQSlider::Below\fR - draw tickmarks below the (horizontal) slider
.TP
\fCQSlider::Left\fR - draw tickmarks to the left of the (vertical) slider
.TP
\fCQSlider::Right\fR - draw tickmarks to the right of the (vertical) slider
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QSlider::QSlider ( QWidget * parent, const char * name = 0 )"
Constructs a vertical slider.
.PP
The \fIparent\fR and \fIname\fR arguments are sent on to the QWidget constructor.
.SH "QSlider::QSlider ( Orientation orientation, QWidget * parent, const char * name = 0 )"
Constructs a slider.
.PP
The \fIorientation\fR must be Qt::Vertical or Qt::Horizontal.
.PP
The \fIparent\fR and \fIname\fR arguments are sent on to the QWidget constructor.
.SH "QSlider::QSlider ( int minValue, int maxValue, int pageStep, int value, Orientation orientation, QWidget * parent, const char * name = 0 )"
Constructs a slider whose value can never be smaller than \fIminValue\fR or greater than \fImaxValue\fR, whose page step size is \fIpageStep\fR and whose value is initially \fIvalue\fR (which is guaranteed to be in range using bound()).
.PP
If \fIorientation\fR is Qt::Vertical the slider is vertical and if it is Qt::Horizontal the slider is horizontal.
.PP
The \fIparent\fR and \fIname\fR arguments are sent on to the QWidget constructor.
.SH "QSlider::~QSlider ()"
Destructor.
.SH "void QSlider::addStep ()\fC [slot]\fR"
Moves the slider one pageStep() up or right.
.SH "int QSlider::lineStep () const"
Returns the current line step. See the "lineStep" property for details.
.SH "int QSlider::maxValue () const"
Returns the current maximum value of the slider. See the "maxValue" property for details.
.SH "int QSlider::minValue () const"
Returns the current minimum value of the slider. See the "minValue" property for details.
.SH "Orientation QSlider::orientation () const"
Returns the slider's orientation. See the "orientation" property for details.
.SH "int QSlider::pageStep () const"
Returns the current page step. See the "pageStep" property for details.
.SH "void QSlider::rangeChange ()\fC [virtual protected]\fR"
Implements the virtual QRangeControl function.
.PP
Reimplemented from QRangeControl.
.SH "void QSlider::setLineStep ( int )"
Sets the current line step. See the "lineStep" property for details.
.SH "void QSlider::setMaxValue ( int )"
Sets the current maximum value of the slider. See the "maxValue" property for details.
.SH "void QSlider::setMinValue ( int )"
Sets the current minimum value of the slider. See the "minValue" property for details.
.SH "void QSlider::setOrientation ( Orientation )\fC [virtual]\fR"
Sets the slider's orientation. See the "orientation" property for details.
.SH "void QSlider::setPageStep ( int )"
Sets the current page step. See the "pageStep" property for details.
.SH "void QSlider::setPalette ( const QPalette & p )\fC [virtual]\fR"
Reimplements the virtual function QWidget::setPalette().
.PP
Sets the background color to the mid color for Motif style sliders using palette \fIp\fR.
.PP
Reimplemented from QWidget.
.SH "void QRangeControl::setRange ( int minValue, int maxValue )"
Sets the range control's minimum value to \fIminValue\fR and its maximum value to \fImaxValue\fR.
.PP
Calls the virtual rangeChange() function if one or both of the new minimum and maximum values are different from the previous setting. Calls the virtual valueChange() function if the current value is adjusted because it was outside the new range.
.PP
If \fImaxValue\fR is smaller than \fIminValue\fR, \fIminValue\fR becomes the only legal value.
.PP
See also minValue and maxValue.
.PP
Examples:
.)l listbox/listbox.cpp, t12/lcdrange.cpp, t5/main.cpp, t6/main.cpp, t8/lcdrange.cpp, and xform/xform.cpp.
.SH "void QSlider::setTickInterval ( int )\fC [virtual]\fR"
Sets the interval between tickmarks. See the "tickInterval" property for details.
.SH "void QSlider::setTickmarks ( TickSetting )\fC [virtual]\fR"
Sets the tickmark settings for this slider. See the "tickmarks" property for details.
.SH "void QSlider::setTracking ( bool enable )\fC [virtual]\fR"
Sets whether slider tracking is enabled to \fIenable\fR. See the "tracking" property for details.
.SH "void QSlider::setValue ( int )\fC [virtual slot]\fR"
Sets the current slider value. See the "value" property for details.
.SH "void QSlider::sliderMoved ( int value )\fC [signal]\fR"
This signal is emitted when the slider is dragged, with the new slider \fIvalue\fR as its argument.
.SH "void QSlider::sliderPressed ()\fC [signal]\fR"
This signal is emitted when the user presses the slider with the mouse.
.SH "QRect QSlider::sliderRect () const"
Returns the slider handle rectangle. (This is the visual marker that the user can move.)
.SH "void QSlider::sliderReleased ()\fC [signal]\fR"
This signal is emitted when the user releases the slider with the mouse.
.SH "int QSlider::sliderStart () const"
Returns the start position of the slider.
.SH "void QSlider::subtractStep ()\fC [slot]\fR"
Moves the slider one pageStep() down or left.
.SH "int QSlider::tickInterval () const"
Returns the interval between tickmarks. See the "tickInterval" property for details.
.SH "TickSetting QSlider::tickmarks () const"
Returns the tickmark settings for this slider. See the "tickmarks" property for details.
.SH "bool QSlider::tracking () const"
Returns TRUE if slider tracking is enabled; otherwise returns FALSE. See the "tracking" property for details.
.SH "int QSlider::value () const"
Returns the current slider value. See the "value" property for details.
.SH "void QSlider::valueChange ()\fC [virtual protected]\fR"
Implements the virtual QRangeControl function.
.PP
Reimplemented from QRangeControl.
.SH "void QSlider::valueChanged ( int value )\fC [signal]\fR"
This signal is emitted when the slider value is changed, with the new slider \fIvalue\fR as its argument.
.PP
Examples:
.)l rangecontrols/rangecontrols.cpp, simple/main.cpp, t12/lcdrange.cpp, t5/main.cpp, t6/main.cpp, t7/lcdrange.cpp, and xform/xform.cpp.
.SS "Property Documentation"
.SH "int lineStep"
This property holds the current line step.
.PP
When setting lineStep, the virtual stepChange() function will be called if the new line step is different from the previous setting.
.PP
See also setSteps(), QRangeControl::pageStep(), and setRange().
.PP
Set this property's value with setLineStep() and get this property's value with lineStep().
.SH "int maxValue"
This property holds the current maximum value of the slider.
.PP
When setting this property, the QSlider::minValue is adjusted, if necessary, to ensure that the range remains valid.
.PP
See also setRange().
.PP
Set this property's value with setMaxValue() and get this property's value with maxValue().
.SH "int minValue"
This property holds the current minimum value of the slider.
.PP
When setting this property, the QSlider::maxValue is adjusted, if necessary, to ensure that the range remains valid.
.PP
See also setRange().
.PP
Set this property's value with setMinValue() and get this property's value with minValue().
.SH "Orientation orientation"
This property holds the slider's orientation.
.PP
The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
.PP
Set this property's value with setOrientation() and get this property's value with orientation().
.SH "int pageStep"
This property holds the current page step.
.PP
When setting pageStep, the virtual stepChange() function will be called if the new page step is different from the previous setting.
.PP
See also QRangeControl::setSteps(), lineStep, and setRange().
.PP
Set this property's value with setPageStep() and get this property's value with pageStep().
.SH "int tickInterval"
This property holds the interval between tickmarks.
.PP
This is a value interval, not a pixel interval. If it is 0, the slider will choose between lineStep() and pageStep(). The initial value of tickInterval is 0.
.PP
See also QRangeControl::lineStep() and QRangeControl::pageStep().
.PP
Set this property's value with setTickInterval() and get this property's value with tickInterval().
.SH "TickSetting tickmarks"
This property holds the tickmark settings for this slider.
.PP
The valid values are in QSlider::TickSetting. The default is NoMarks.
.PP
See also tickInterval.
.PP
Set this property's value with setTickmarks() and get this property's value with tickmarks().
.SH "bool tracking"
This property holds whether slider tracking is enabled.
.PP
If tracking is enabled (the default), the slider emits the valueChanged() signal whenever the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal when the user releases the mouse button (unless the value happens to be the same as before).
.PP
Set this property's value with setTracking() and get this property's value with tracking().
.SH "int value"
This property holds the current slider value.
.PP
Set this property's value with setValue() and get this property's value with value().
.PP
See also QRangeControl::value() and prevValue().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqslider.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqslider.3qt) and the Qt
version (3.3.8).