1QScrollBar(3qt)                                                QScrollBar(3qt)
2
3
4

NAME

6       QScrollBar - Vertical or horizontal scroll bar
7

SYNOPSIS

9       #include <qscrollbar.h>
10
11       Inherits QWidget and QRangeControl.
12
13   Public Members
14       QScrollBar ( QWidget * parent, const char * name = 0 )
15       QScrollBar ( Orientation orientation, QWidget * parent, const char *
16           name = 0 )
17       QScrollBar ( int minValue, int maxValue, int lineStep, int pageStep,
18           int value, Orientation orientation, QWidget * parent, const char *
19           name = 0 )
20       ~QScrollBar ()
21       virtual void setOrientation ( Orientation )
22       Orientation orientation () const
23       virtual void setTracking ( bool enable )
24       bool tracking () const
25       bool draggingSlider () const
26       virtual void setPalette ( const QPalette & p )
27       int minValue () const
28       int maxValue () const
29       void setMinValue ( int )
30       void setMaxValue ( int )
31       int lineStep () const
32       int pageStep () const
33       void setLineStep ( int )
34       void setPageStep ( int )
35       int value () const
36       int sliderStart () const
37       QRect sliderRect () const
38
39   Public Slots
40       void setValue ( int )
41
42   Signals
43       void valueChanged ( int value )
44       void sliderPressed ()
45       void sliderMoved ( int value )
46       void sliderReleased ()
47       void nextLine ()
48       void prevLine ()
49       void nextPage ()
50       void prevPage ()
51
52   Properties
53       bool draggingSlider - whether the user has clicked the mouse on the
54           slider and is currently dragging it  (read only)
55       int lineStep - the line step
56       int maxValue - the scroll bar's maximum value
57       int minValue - the scroll bar's minimum value
58       Orientation orientation - the orientation of the scroll bar
59       int pageStep - the page step
60       bool tracking - whether scroll bar tracking is enabled
61       int value - the scroll bar's value
62
63   Protected Members
64       virtual void hideEvent ( QHideEvent * )
65

DESCRIPTION

67       The QScrollBar widget provides a vertical or horizontal scroll bar.
68
69       A scroll bar allows the user to control a value within a program-
70       definable range and gives users a visible indication of the current
71       value of a range control.
72
73       Scroll bars include four separate controls:
74
75       The line-up and line-down controls are little buttons which the user
76       can use to move one "line" up or down. The meaning of line is
77       configurable. In editors and list boxes it means one line of text; in
78       an image viewer it might mean 20 pixels.
79
80       The slider is the handle that indicates the current value of the scroll
81       bar, which the user can drag to change the value. This part of the
82       scroll bar is sometimes called the "thumb".
83
84       The page-up/page-down control is the area on which the slider slides
85       (the scroll bar's background). Clicking here moves the scroll bar
86       towards the click. The meaning of "page" is also configurable: in
87       editors and list boxes it means as many lines as there is space for in
88       the widget.
89
90       QScrollBar has very few of its own functions; it mostly relies on
91       QRangeControl. The most useful functions are setValue() to set the
92       scroll bar directly to some value; addPage(), addLine(),
93       subtractPage(), and subtractLine() to simulate the effects of clicking
94       (useful for accelerator keys); setSteps() to define the values of
95       pageStep() and lineStep(); and setRange() to set the minValue() and
96       maxValue() of the scroll bar. QScrollBar has a convenience constructor
97       with which you can set most of these properties.
98
99       Some GUI styles (for example, the Windows and Motif styles provided
100       with Qt), also use the pageStep() value to calculate the size of the
101       slider.
102
103       In addition to the access functions from QRangeControl, QScrollBar
104       provides a comprehensive set of signals: <center>.nf
105
106       </center>
107
108       QScrollBar only provides integer ranges. Note that although QScrollBar
109       handles very large numbers, scroll bars on current screens cannot
110       usefully control ranges above about 100,000 pixels. Beyond that, it
111       becomes difficult for the user to control the scroll bar using either
112       the keyboard or the mouse.
113
114       A scroll bar can be controlled by the keyboard, but it has a default
115       focusPolicy() of NoFocus. Use setFocusPolicy() to enable keyboard
116       focus. See keyPressEvent() for a list of key bindings.
117
118       If you need to add scroll bars to an interface, consider using the
119       QScrollView class, which encapsulates the common uses for scroll bars.
120
121                                   [Image Omitted]
122
123                                   [Image Omitted]
124
125       See also QSlider, QSpinBox, QScrollView, GUI Design Handbook: Scroll
126       Bar, and Basic Widgets.
127

MEMBER FUNCTION DOCUMENTATION

QScrollBar::QScrollBar ( QWidget * parent, const char * name = 0 )

130       Constructs a vertical scroll bar.
131
132       The parent and name arguments are sent on to the QWidget constructor.
133
134       The minValue defaults to 0, the maxValue to 99, with a lineStep size of
135       1 and a pageStep size of 10, and an initial value of 0.
136

QScrollBar::QScrollBar ( Orientation orientation, QWidget * parent, const char

138       * name = 0 )
139       Constructs a scroll bar.
140
141       The orientation must be Qt::Vertical or Qt::Horizontal.
142
143       The parent and name arguments are sent on to the QWidget constructor.
144
145       The minValue defaults to 0, the maxValue to 99, with a lineStep size of
146       1 and a pageStep size of 10, and an initial value of 0.
147

QScrollBar::QScrollBar ( int minValue, int maxValue, int lineStep, int

149       pageStep, int value, Orientation orientation, QWidget * parent, const
150       char * name = 0 )
151       Constructs a scroll bar whose value can never be smaller than minValue
152       or greater than maxValue, whose line step size is lineStep and page
153       step size is pageStep and whose value is initially value (which is
154       guaranteed to be in range using bound()).
155
156       If orientation is Vertical the scroll bar is vertical and if it is
157       Horizontal the scroll bar is horizontal.
158
159       The parent and name arguments are sent on to the QWidget constructor.
160

QScrollBar::~QScrollBar ()

162       Destructor.
163

bool QScrollBar::draggingSlider () const

165       Returns TRUE if the user has clicked the mouse on the slider and is
166       currently dragging it; otherwise returns FALSE. See the
167       "draggingSlider" property for details.
168

void QScrollBar::hideEvent ( QHideEvent * ) [virtual protected]

170       This function is called when the scrollbar is hidden.
171
172       Reimplemented from QWidget.
173

int QScrollBar::lineStep () const

175       Returns the line step. See the "lineStep" property for details.
176

int QScrollBar::maxValue () const

178       Returns the scroll bar's maximum value. See the "maxValue" property for
179       details.
180

int QScrollBar::minValue () const

182       Returns the scroll bar's minimum value. See the "minValue" property for
183       details.
184

void QScrollBar::nextLine () [signal]

186       This signal is emitted when the scroll bar scrolls one line down or
187       right.
188

void QScrollBar::nextPage () [signal]

190       This signal is emitted when the scroll bar scrolls one page down or
191       right.
192

Orientation QScrollBar::orientation () const

194       Returns the orientation of the scroll bar. See the "orientation"
195       property for details.
196

int QScrollBar::pageStep () const

198       Returns the page step. See the "pageStep" property for details.
199

void QScrollBar::prevLine () [signal]

201       This signal is emitted when the scroll bar scrolls one line up or left.
202

void QScrollBar::prevPage () [signal]

204       This signal is emitted when the scroll bar scrolls one page up or left.
205

void QScrollBar::setLineStep ( int )

207       Sets the line step. See the "lineStep" property for details.
208

void QScrollBar::setMaxValue ( int )

210       Sets the scroll bar's maximum value. See the "maxValue" property for
211       details.
212

void QScrollBar::setMinValue ( int )

214       Sets the scroll bar's minimum value. See the "minValue" property for
215       details.
216

void QScrollBar::setOrientation ( Orientation ) [virtual]

218       Sets the orientation of the scroll bar. See the "orientation" property
219       for details.
220

void QScrollBar::setPageStep ( int )

222       Sets the page step. See the "pageStep" property for details.
223

void QScrollBar::setPalette ( const QPalette & p ) [virtual]

225       Reimplements the virtual function QWidget::setPalette().
226
227       Sets the background color to the mid color for Motif style scroll bars
228       using palette p.
229
230       Reimplemented from QWidget.
231

void QScrollBar::setTracking ( bool enable ) [virtual]

233       Sets whether scroll bar tracking is enabled to enable. See the
234       "tracking" property for details.
235

void QScrollBar::setValue ( int ) [slot]

237       Sets the scroll bar's value. See the "value" property for details.
238

void QScrollBar::sliderMoved ( int value ) [signal]

240       This signal is emitted when the slider is dragged by the user, with the
241       new scroll bar value as an argument.
242
243       This signal is emitted even when tracking is turned off.
244
245       See also tracking, valueChanged(), nextLine(), prevLine(), nextPage(),
246       and prevPage().
247

void QScrollBar::sliderPressed () [signal]

249       This signal is emitted when the user presses the slider with the mouse.
250

QRect QScrollBar::sliderRect () const

252       Returns the scroll bar slider rectangle.
253
254       See also sliderStart().
255

void QScrollBar::sliderReleased () [signal]

257       This signal is emitted when the user releases the slider with the
258       mouse.
259

int QScrollBar::sliderStart () const

261       Returns the pixel position where the scroll bar slider starts.
262
263       This is equivalent to sliderRect().y() for vertical scroll bars or
264       sliderRect().x() for horizontal scroll bars.
265

bool QScrollBar::tracking () const

267       Returns TRUE if scroll bar tracking is enabled; otherwise returns
268       FALSE. See the "tracking" property for details.
269

int QScrollBar::value () const

271       Returns the scroll bar's value. See the "value" property for details.
272

void QScrollBar::valueChanged ( int value ) [signal]

274       This signal is emitted when the scroll bar value has changed, with the
275       new scroll bar value as an argument.
276
277   Property Documentation

bool draggingSlider

279       This property holds whether the user has clicked the mouse on the
280       slider and is currently dragging it.
281
282       Get this property's value with draggingSlider().
283

int lineStep

285       This property holds the line step.
286
287       When setting lineStep, the virtual stepChange() function will be called
288       if the new line step is different from the previous setting.
289
290       See also setSteps(), QRangeControl::pageStep(), and setRange().
291
292       Set this property's value with setLineStep() and get this property's
293       value with lineStep().
294

int maxValue

296       This property holds the scroll bar's maximum value.
297
298       When setting this property, the QScrollBar::minValue is adjusted if
299       necessary to ensure that the range remains valid.
300
301       See also setRange().
302
303       Set this property's value with setMaxValue() and get this property's
304       value with maxValue().
305

int minValue

307       This property holds the scroll bar's minimum value.
308
309       When setting this property, the QScrollBar::maxValue is adjusted if
310       necessary to ensure that the range remains valid.
311
312       See also setRange().
313
314       Set this property's value with setMinValue() and get this property's
315       value with minValue().
316

Orientation orientation

318       This property holds the orientation of the scroll bar.
319
320       The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
321
322       Set this property's value with setOrientation() and get this property's
323       value with orientation().
324

int pageStep

326       This property holds the page step.
327
328       When setting pageStep, the virtual stepChange() function will be called
329       if the new page step is different from the previous setting.
330
331       See also QRangeControl::setSteps(), lineStep, and setRange().
332
333       Set this property's value with setPageStep() and get this property's
334       value with pageStep().
335

bool tracking

337       This property holds whether scroll bar tracking is enabled.
338
339       If tracking is enabled (the default), the scroll bar emits the
340       valueChanged() signal while the slider is being dragged. If tracking is
341       disabled, the scroll bar emits the valueChanged() signal only when the
342       user releases the mouse button after moving the slider.
343
344       Set this property's value with setTracking() and get this property's
345       value with tracking().
346

int value

348       This property holds the scroll bar's value.
349
350       Set this property's value with setValue() and get this property's value
351       with value().
352
353       See also QRangeControl::value() and prevValue().
354
355

SEE ALSO

357       http://doc.trolltech.com/qscrollbar.html
358       http://www.trolltech.com/faq/tech.html
359
361       Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
362       license file included in the distribution for a complete license
363       statement.
364

AUTHOR

366       Generated automatically from the source code.
367

BUGS

369       If you find a bug in Qt, please report it as described in
370       http://doc.trolltech.com/bughowto.html.  Good bug reports help us to
371       help you. Thank you.
372
373       The definitive Qt documentation is provided in HTML format; it is
374       located at $QTDIR/doc/html and can be read using Qt Assistant or with a
375       web browser. This man page is provided as a convenience for those users
376       who prefer man pages, although this format is not officially supported
377       by Trolltech.
378
379       If you find errors in this manual page, please report them to qt-
380       bugs@trolltech.com.  Please include the name of the manual page
381       (qscrollbar.3qt) and the Qt version (3.3.8).
382
383
384
385Trolltech AS                    2 February 2007                QScrollBar(3qt)
Impressum