📄 qwtsliderbase.3
字号:
.TH "QwtSliderBase" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtSliderBase \- .SH SYNOPSIS.br.PPInherits \fBQwtDblRange\fP..PPInherited by \fBQwtDial\fP, \fBQwtKnob\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP..PP.SH "Detailed Description".PP A Base class for sliders. QwtSliderBase is a base class for slider widgets. QwtSliderBase handles the mouse events and updates the slider's value accordingly. Derived classes only have to implement the \fBgetValue()\fP and \fBgetScrollMode()\fP members, and should react to a \fBvalueChange()\fP, which normally requires repainting. .PP.SS "Public Types".in +1c.ti -1c.RI "enum \fBScrollMode\fP { \fBScrNone\fP, \fBScrMouse\fP, \fBScrTimer\fP, \fBScrDirect\fP, \fBScrPage\fP }".br.in -1c.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtSliderBase\fP (Qt::Orientation orientation, QWidget *parent=0, const char *name=0, WFlags flags=0)".br.ti -1c.RI "virtual \fB~QwtSliderBase\fP ()".br.ti -1c.RI "void \fBsetUpdateTime\fP (int t)".br.ti -1c.RI "void \fBstopMoving\fP ()".br.ti -1c.RI "void \fBsetTracking\fP (bool enable)".br.ti -1c.RI "virtual void \fBsetMass\fP (double val)".br.ti -1c.RI "virtual double \fBmass\fP () const ".br.ti -1c.RI "virtual void \fBsetOrientation\fP (Orientation o)".br.ti -1c.RI "Orientation \fBorientation\fP () const ".br.ti -1c.RI "bool \fBisReadOnly\fP () const ".br.ti -1c.RI "bool \fBisValid\fP () const ".br.ti -1c.RI "void \fBsetValid\fP (bool valid)".br.ti -1c.RI "virtual void \fBsetValue\fP (double val)".br.ti -1c.RI "virtual void \fBfitValue\fP (double val)".br.ti -1c.RI "virtual void \fBincValue\fP (int steps)".br.ti -1c.RI "virtual void \fBsetReadOnly\fP (bool)".br.in -1c.SS "Protected Member Functions".in +1c.ti -1c.RI "void \fBvalueChanged\fP (double value)".br.ti -1c.RI "void \fBsliderPressed\fP ()".br.ti -1c.RI "void \fBsliderReleased\fP ()".br.ti -1c.RI "void \fBsliderMoved\fP (double value)".br.ti -1c.RI "void \fBsetPosition\fP (const QPoint &p)".br.ti -1c.RI "virtual void \fBvalueChange\fP ()".br.ti -1c.RI "virtual void \fBtimerEvent\fP (QTimerEvent *e)".br.ti -1c.RI "virtual void \fBmousePressEvent\fP (QMouseEvent *e)".br.ti -1c.RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *e)".br.ti -1c.RI "virtual void \fBmouseMoveEvent\fP (QMouseEvent *e)".br.ti -1c.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *e)".br.ti -1c.RI "virtual void \fBwheelEvent\fP (QWheelEvent *e)".br.ti -1c.RI "virtual double \fBgetValue\fP (const QPoint &p)=0".br.ti -1c.RI "virtual void \fBgetScrollMode\fP (const QPoint &p, int &scrollMode, int &direction)=0".br.in -1c.SS "Protected Attributes".in +1c.ti -1c.RI "int \fBd_scrollMode\fP".br.ti -1c.RI "double \fBd_mouseOffset\fP".br.ti -1c.RI "int \fBd_direction\fP".br.ti -1c.RI "int \fBd_tracking\fP".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtSliderBase::QwtSliderBase (Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0, WFlags flags = 0)".PPConstructor. .SS "QwtSliderBase::~\fBQwtSliderBase\fP ()\fC [virtual]\fP".PPDestructor. .SH "Member Function Documentation".PP .SS "void QwtSliderBase::fitValue (double val)\fC [virtual]\fP".PPSet the slider's value to the nearest integer multiple of the step size. \fBSee also:\fP.RS 4\fBQwtSliderBase::setValue()\fP .RE.PPReimplemented from \fBQwtDblRange\fP..SS "virtual void QwtSliderBase::getScrollMode (const QPoint & p, int & scrollMode, int & direction)\fC [protected, pure virtual]\fP".PPDetermine what to do when the user presses a mouse button. This function is abstract and has to be implemented by derived classes. It is called on a mousePress event. The derived class can determine what should happen next in dependence of the position where the mouse was pressed by returning scrolling mode and direction. QwtSliderBase knows the following modes:.IP "\fBQwtSliderBase::ScrNone \fP" 1cScrolling switched off. Don't change the value. .IP "\fBQwtSliderBase::ScrMouse \fP" 1cChange the value while the user keeps the button pressed and moves the mouse. .IP "\fBQwtSliderBase::ScrTimer \fP" 1cAutomatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed. .IP "\fBQwtSliderBase::ScrPage \fP" 1cAutomatic scrolling. Same as ScrTimer, but increment by page size..PP.PP\fBParameters:\fP.RS 4\fIp\fP point where the mouse was pressed .RE.PP\fBReturn values:\fP.RS 4\fIscrollMode\fP The scrolling mode .br\fIdirection\fP direction: 1, 0, or -1. .RE.PPImplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP..SS "virtual double QwtSliderBase::getValue (const QPoint & p)\fC [protected, pure virtual]\fP".PPDetermine the value corresponding to a specified poind. This is an abstract virtual function which is called when the user presses or releases a mouse button or moves the mouse. It has to be implemented by the derived class. .PP\fBParameters:\fP.RS 4\fIp\fP point .RE.PPImplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP..SS "void QwtSliderBase::incValue (int steps)\fC [virtual]\fP".PPIncrement the value by a specified number of steps. \fBParameters:\fP.RS 4\fIsteps\fP number of steps .RE.PPReimplemented from \fBQwtDblRange\fP..SS "bool QwtSliderBase::isReadOnly () const".PPIn read only mode the slider can磘 be controlled by mouse or keyboard..PP\fBReturns:\fP.RS 4TRUE if read only .RE.PP\fBSee also:\fP.RS 4\fBsetReadOnly\fP .RE.PP.SS "bool QwtSliderBase::isValid () const".PP\fBSee also:\fP.RS 4\fBQwtDblRange::isValid\fP .RE.PPReimplemented from \fBQwtDblRange\fP..SS "void QwtSliderBase::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP".PPHandles key events.PP.IP "\(bu" 2Key_Down, KeyLeft.br Decrement by 1.IP "\(bu" 2Key_Up, Key_Right.br Increment by 1.PP.PP\fBSee also:\fP.RS 4\fBisReadOnly()\fP .RE.PPReimplemented in \fBQwtCompass\fP, and \fBQwtDial\fP..SS "double QwtSliderBase::mass () const\fC [virtual]\fP".PP\fBReturns:\fP.RS 4mass .RE.PP\fBSee also:\fP.RS 4\fBQwtSliderBase::setMass\fP .RE.PPReimplemented in \fBQwtWheel\fP..SS "void QwtSliderBase::mouseMoveEvent (QMouseEvent * e)\fC [protected, virtual]\fP".PPMouse Move Event handler. .SS "void QwtSliderBase::mousePressEvent (QMouseEvent * e)\fC [protected, virtual]\fP".PPMouse press event handler. .SS "void QwtSliderBase::mouseReleaseEvent (QMouseEvent * e)\fC [protected, virtual]\fP".PPMouse Release Event handler. .SS "Qt::Orientation QwtSliderBase::orientation () const".PP\fBReturns:\fP.RS 4Orientation .RE.PP\fBSee also:\fP.RS 4\fBQwtSliderBase::setOrientation\fP .RE.PP.SS "void QwtSliderBase::setMass (double val)\fC [virtual]\fP".PPSet the slider's mass for flywheel effect. If the slider's mass is greater then 0, it will continue to move after the mouse button has been released. Its speed decreases with time at a rate depending on the slider's mass. A large mass means that it will continue to move for a long time..PPDerived widgets may overload this function to make it public..PP\fBParameters:\fP.RS 4\fIval\fP new mass in kg.RE.PP.PP\fB\fP.RS 4.RE.PP\fBSee also:\fP.RS 4\fBQwtSliderBase::mass\fP .RE.PPReimplemented in \fBQwtWheel\fP..SS "void QwtSliderBase::setOrientation (Orientation o)\fC [virtual]\fP".PPSet the orientation. \fBParameters:\fP.RS 4\fIo\fP Orientation. Allowed values are Qt::Horizontal and Qt::Vertical. .RE.PP.SS "void QwtSliderBase::setPosition (const QPoint & p)\fC [protected]\fP".PPMove the slider to a specified point, adjust the value and emit signals if necessary. .SS "void QwtSliderBase::setReadOnly (bool readOnly)\fC [virtual]\fP".PPEn/Disable read only mode.PPIn read only mode the slider can磘 be controlled by mouse or keyboard..PP\fBParameters:\fP.RS 4\fIreadOnly\fP Enables in case of TRUE .RE.PP\fBSee also:\fP.RS 4\fBisReadOnly\fP .RE.PP.SS "void QwtSliderBase::setTracking (bool enable)".PPEnables or disables tracking. If tracking is enabled, the slider emits a \fBvalueChanged()\fP signal whenever its value changes (the default behaviour). If tracking is disabled, the value changed() signal will only be emitted if:.IP "\(bu" 2the user releases the mouse button and the value has changed or .IP "\(bu" 2at the end of automatic scrolling..PPTracking is enabled by default. .PP\fBParameters:\fP.RS 4\fIenable\fP \fCTRUE\fP (enable) or \fCFALSE\fP (disable) tracking. .RE.PP.SS "void QwtSliderBase::setUpdateTime (int t)".PPSpecify the update interval for automatic scrolling. \fBParameters:\fP.RS 4\fIt\fP update interval in milliseconds .RE.PP\fBSee also:\fP.RS 4\fBQwtSliderBase::getScrollMode()\fP .RE.PP.SS "void QwtSliderBase::setValid (bool valid)".PP\fBSee also:\fP.RS 4\fBQwtDblRange::isValid\fP .RE.PPReimplemented from \fBQwtDblRange\fP..SS "void QwtSliderBase::setValue (double val)\fC [virtual]\fP".PPMove the slider to a specified value. This function can be used to move the slider to a value which is not an integer multiple of the step size. .PP\fBParameters:\fP.RS 4\fIval\fP new value .RE.PP\fBSee also:\fP.RS 4\fBQwtSliderBase::fitValue\fP .RE.PPReimplemented from \fBQwtDblRange\fP..SS "void QwtSliderBase::sliderMoved (double value)\fC [protected]\fP".PPThis signal is emitted when the user moves the slider with the mouse. .PP\fBParameters:\fP.RS 4\fIvalue\fP new value .RE.PP.SS "void QwtSliderBase::sliderPressed ()\fC [protected]\fP".PPThis signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode). .SS "void QwtSliderBase::sliderReleased ()\fC [protected]\fP".PPThis signal is emitted when the user releases the movable part of the slider. .SS "void QwtSliderBase::stopMoving ()".PPStop updating if automatic scrolling is active. .SS "void QwtSliderBase::timerEvent (QTimerEvent * e)\fC [protected, virtual]\fP".PPQt timer event. .SS "void QwtSliderBase::valueChange ()\fC [protected, virtual]\fP".PPNotify change of value.PPThis function can be reimplemented by derived classes in order to keep track of changes, i.e. repaint the widget. The default implementation emits a \fBvalueChanged()\fP signal if tracking is enabled. Reimplemented from \fBQwtDblRange\fP..PPReimplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP..SS "void QwtSliderBase::valueChanged (double value)\fC [protected]\fP".PPNotify a change of value. In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see \fBsetTracking()\fP ). .PP\fBParameters:\fP.RS 4\fIvalue\fP new value .RE.PP.SS "void QwtSliderBase::wheelEvent (QWheelEvent * e)\fC [protected, virtual]\fP".PPQt wheel event. .SH "Author".PP Generated automatically by Doxygen for Qwt User's Guide from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -