⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qscrollbar.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
字号:
'\" t.TH QScrollBar 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQScrollBar \- Vertical or horizontal scroll bar.br.PP\fC#include <qscrollbar.h>\fR.PPInherits QRangeControl and QWidget..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQScrollBar\fR ( QWidget * " "parent" ", const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQScrollBar\fR ( Orientation, QWidget * " "parent" ", const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQScrollBar\fR ( int " "minValue" ", int " "maxValue" ", int " "LineStep" ", int " "PageStep" ", int " "value" ", Orientation, QWidget * " "parent" ", const char * " "name" "=0 ) ".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 "bool \fBdraggingSlider\fR () const".br.ti -1c.BI "virtual void \fBsetPalette\fR ( const QPalette & ) ".br.ti -1c.BI "void \fBsetMinValue\fR ( int ) ".br.ti -1c.BI "void \fBsetMaxValue\fR ( int ) ".br.ti -1c.BI "void \fBsetLineStep\fR ( int ) ".br.ti -1c.BI "void \fBsetPageStep\fR ( int ) ".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.ti -1c.BI "void \fBnextLine\fR () ".br.ti -1c.BI "void \fBprevLine\fR () ".br.ti -1c.BI "void \fBnextPage\fR () ".br.ti -1c.BI "void \fBprevPage\fR () ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBvalueChange\fR () (internal)".br.ti -1c.BI "virtual void \fBstepChange\fR () (internal)".br.ti -1c.BI "virtual void \fBrangeChange\fR () (internal)".br.ti -1c.BI "int \fBsliderStart\fR () const".br.ti -1c.BI "QRect \fBsliderRect\fR () const".br.in -1c.SS "Properties".nf.TSl l l l l- - - - -l l l l l.Type	Name	READ	WRITE	Optionsint	minValue	minValue	setMinValueint	maxValue	maxValue	setMaxValueint	lineStep	lineStep	setLineStepint	pageStep	pageStep	setPageStepint	value	value	setValuebool	tracking	tracking	setTrackingbool	draggingSlider	draggingSliderOrientation	orientation	orientation	setOrientation.TE.fi.SH DESCRIPTIONThe QScrollBar widget provides a vertical or horizontal scroll bar..PPA scroll bar allows the user to control a value within a program-definable range, and to give the user visible indication of the current value of a range control..PPScroll bars include four separate controls:.TPThe \fIline-up\fR and \fIline-down\fR controls are little button with which the user can move one line up or down. The meaning of "line" is configurable. In editors and list boxes it means one line of text, while an image viewer it might mean 20 pixels..TPThe \fIslider\fR is the handle that indicates the current value of the scroll bar, and which the user can drag to change the value. This part of the scroll bar is sometimes called the "thumb"..TPThe \fIpage-up/down\fR control is the area on which the slider slides (the scroll bar's background). Clicking here moves the scroll bar towards the click. The meaning of page is also configurable - in editors and list boxes it means as many lines as there is space for in the widget..PPQScrollBar has not much of an API of its own; it mostly relies on QRangeControl. The most useful functions are setValue() to set the scroll bar directly to some value; addPage(), addLine(), subtractPage() and subtractLine() to simulate the effects of clicking (useful for accelerator keys; setSteps() to define the values of pageStep() and lineStep(); and setRange() to set the minValue() and maxValue() of the scroll bar. QScrollBar has a convenience constructor with which you can set most of these properties..PPSome GUI styles, for example the provided Windows and Motif styles, also use the pageStep() value to calculate the size of the slider..PPIn addition to the access functions from QRangeControl, QScrollBar has a comprehensive set of signals:.TPvalueChanged() - emitted when the scroll bar's value has changed. The tracking() determines whether this signal is emitted \fIduring\fR interaction..TPsliderPressed() - emitted when the user starts to drag the slider.TPsliderMoved() - emitted when the user drags the slider.TPsliderReleased() - emitted when the user releases the slider.TPnextLine() - emitted when the scroll bar has moved one line down/rightwards. Line is defined in QRangeControl..TPprevLine() - emitted when the scroll bar has moved one line up/leftwards..TPnextPage() - emitted when the scroll bar has moved one page down/rightwards..TPprevPage() - emitted when the scroll bar has moved one page up/leftwards..PPQScrollBar only offers integer ranges. Note that while QScrollBar handles very large numbers, scroll bars on today's screens cannot usefully control ranges above about 100,000 pixels. Beyond that, it becomes difficult for the user to control the scroll bar using either keyboard or mouse..PPA scroll bar can be controlled by the keyboard, but it has a default focusPolicy() of \fCNoFocus.\fR Use setFocusPolicy() to enable keyboard focus. See keyPressEvent() for a list of key bindings..PPIf you need to add scrollbars to an interface, consider using the QScrollView class which encapsulates the common uses for scrollbars..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QSlider, QSpinBox, QScrollView and GUI Design Handbook: Scroll Bar.SH MEMBER FUNCTION DOCUMENTATION.SH "QScrollBar::QScrollBar ( QWidget * parent, const char * name=0 )"Constructs a vertical scroll bar..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..SH "bool QScrollBar::draggingSlider () const"Returns TRUE if the user has clicked the mouse on the slider and is currently dragging it, or FALSE if not..SH "void QScrollBar::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "int QScrollBar::lineStep () const"Reimplemented for internal reasons; the API is not affected..SH "int QScrollBar::maxValue () const"Reimplemented for internal reasons; the API is not affected..SH "int QScrollBar::minValue () const"Reimplemented for internal reasons; the API is not affected..SH "void QScrollBar::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::nextLine () \fC[signal]\fR"This signal is emitted when the scroll bar scrolls one line down/right..SH "void QScrollBar::nextPage () \fC[signal]\fR"This signal is emitted when the scroll bar scrolls one page down/right..SH "int QScrollBar::pageStep () const"Reimplemented for internal reasons; the API is not affected..SH "void QScrollBar::paintEvent ( QPaintEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::prevLine () \fC[signal]\fR"This signal is emitted when the scroll bar scrolls one line up/left..SH "void QScrollBar::prevPage () \fC[signal]\fR"This signal is emitted when the scroll bar scrolls one page up/left..SH "void QScrollBar::resizeEvent ( QResizeEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::setLineStep ( int i )"Sets the line step to \fIi.\fR.PPCalls the virtual stepChange() function if the new line step is different from the previous setting..PPSee also lineStep(), QRangeControl::setSteps(), setPageStep() and setRange()..SH "void QScrollBar::setMaxValue ( int i )"A convenience function which just calls setRange( minValue(), i ).PPSee also setRange()..SH "void QScrollBar::setMinValue ( int i )"A convenience function which just calls setRange( i, maxValue() ).PPSee also setRange()..SH "void QScrollBar::setPageStep ( int i )"Sets the page step to \fIi.\fR.PPCalls the virtual stepChange() function if the new page step is different from the previous setting..PPSee also pageStep(), QRangeControl::setSteps(), setLineStep() and setRange()..SH "void QScrollBar::setPalette ( const QPalette & p ) \fC[virtual]\fR"Reimplements the virtual function QWidget::setPalette()..PPSets the background color to the mid color for Motif style scroll bars..SH "void QScrollBar::setTracking ( bool enable ) \fC[virtual]\fR"Enables scroll bar tracking if \fIenable\fR is TRUE, or disables tracking if \fIenable\fR is FALSE..PPIf tracking is enabled (the default), the scroll bar emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the scroll bar emits the valueChanged() signal only when the user releases the mouse button after moving the slider..PPSee also tracking()..SH "void QScrollBar::setValue ( int i )"Reimplemented for internal reasons; the API is not affected..SH "QSize QScrollBar::sizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QSizePolicy QScrollBar::sizePolicy () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::sliderMoved ( int value ) \fC[signal]\fR"This signal is emitted when the slider is moved by the user, with the new scroll bar value as an argument..PPThis signal is emitted even when tracking is turned off..PPSee also tracking(), valueChanged(), nextLine(), prevLine(), nextPage() and prevPage()..SH "void QScrollBar::sliderPressed () \fC[signal]\fR"This signal is emitted when the user presses the slider with the mouse..SH "QRect QScrollBar::sliderRect () const \fC[protected]\fR"Returns the scroll bar slider rectangle..PPSee also sliderStart()..SH "void QScrollBar::sliderReleased () \fC[signal]\fR"This signal is emitted when the user releases the slider with the mouse..SH "int QScrollBar::sliderStart () const \fC[protected]\fR"Returns the pixel position where the scroll bar slider starts..PPIt is equivalent to sliderRect().y() for vertical scroll bars or sliderRect().x() for horizontal scroll bars..SH "void QScrollBar::styleChange ( QStyle & old ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "bool QScrollBar::tracking () const"Returns TRUE if tracking is enabled, or FALSE if tracking is disabled..PPTracking is initially enabled..PPSee also setTracking()..SH "int QScrollBar::value () const"Reimplemented for internal reasons; the API is not affected..SH "void QScrollBar::valueChanged ( int value ) \fC[signal]\fR"This signal is emitted when the scroll bar value has changed, with the new scroll bar value as an argument..SH "void QScrollBar::wheelEvent ( QWheelEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollBar::rangeChange () \fC[virtual protected]\fR"For internal use only..PPReimplemented from QRangeControl..SH "void QScrollBar::stepChange () \fC[virtual protected]\fR"For internal use only..PPReimplemented from QRangeControl..SH "void QScrollBar::valueChange () \fC[virtual protected]\fR"For internal use only..PPReimplemented from QRangeControl..SH "SEE ALSO".BR http://doc.trolltech.com/qscrollbar.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qscrollbar.3qt) and the Qtversion (2.3.10).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -