123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 |
- .TH "QwtAbstractSlider" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
- .ad l
- .nh
- .SH NAME
- QwtAbstractSlider \- An abstract base class for slider widgets with a scale\&.
- .SH SYNOPSIS
- .br
- .PP
- .PP
- \fC#include <qwt_abstract_slider\&.h>\fP
- .PP
- Inherits \fBQwtAbstractScale\fP\&.
- .PP
- Inherited by \fBQwtDial\fP, \fBQwtKnob\fP, and \fBQwtSlider\fP\&.
- .SS "Public Slots"
- .in +1c
- .ti -1c
- .RI "void \fBsetValue\fP (double \fBvalue\fP)"
- .br
- .in -1c
- .SS "Signals"
- .in +1c
- .ti -1c
- .RI "void \fBvalueChanged\fP (double \fBvalue\fP)"
- .br
- .RI "Notify a change of value\&. "
- .ti -1c
- .RI "void \fBsliderPressed\fP ()"
- .br
- .ti -1c
- .RI "void \fBsliderReleased\fP ()"
- .br
- .ti -1c
- .RI "void \fBsliderMoved\fP (double \fBvalue\fP)"
- .br
- .in -1c
- .SS "Public Member Functions"
- .in +1c
- .ti -1c
- .RI "\fBQwtAbstractSlider\fP (QWidget *parent=NULL)"
- .br
- .RI "Constructor\&. "
- .ti -1c
- .RI "virtual \fB~QwtAbstractSlider\fP ()"
- .br
- .RI "Destructor\&. "
- .ti -1c
- .RI "void \fBsetValid\fP (bool)"
- .br
- .ti -1c
- .RI "bool \fBisValid\fP () const"
- .br
- .ti -1c
- .RI "double \fBvalue\fP () const"
- .br
- .RI "Returns the current value\&. "
- .ti -1c
- .RI "void \fBsetWrapping\fP (bool)"
- .br
- .ti -1c
- .RI "bool \fBwrapping\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetTotalSteps\fP (uint)"
- .br
- .RI "Set the number of steps\&. "
- .ti -1c
- .RI "uint \fBtotalSteps\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetSingleSteps\fP (uint)"
- .br
- .RI "Set the number of steps for a single increment\&. "
- .ti -1c
- .RI "uint \fBsingleSteps\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetPageSteps\fP (uint)"
- .br
- .RI "Set the number of steps for a page increment\&. "
- .ti -1c
- .RI "uint \fBpageSteps\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetStepAlignment\fP (bool)"
- .br
- .RI "Enable step alignment\&. "
- .ti -1c
- .RI "bool \fBstepAlignment\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetTracking\fP (bool)"
- .br
- .RI "Enables or disables tracking\&. "
- .ti -1c
- .RI "bool \fBisTracking\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetReadOnly\fP (bool)"
- .br
- .ti -1c
- .RI "bool \fBisReadOnly\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetInvertedControls\fP (bool)"
- .br
- .ti -1c
- .RI "bool \fBinvertedControls\fP () const"
- .br
- .in -1c
- .SS "Protected Member Functions"
- .in +1c
- .ti -1c
- .RI "virtual void \fBmousePressEvent\fP (QMouseEvent *)"
- .br
- .ti -1c
- .RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *)"
- .br
- .ti -1c
- .RI "virtual void \fBmouseMoveEvent\fP (QMouseEvent *)"
- .br
- .ti -1c
- .RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
- .br
- .ti -1c
- .RI "virtual void \fBwheelEvent\fP (QWheelEvent *)"
- .br
- .ti -1c
- .RI "virtual bool \fBisScrollPosition\fP (const QPoint &pos) const =0"
- .br
- .RI "Determine what to do when the user presses a mouse button\&. "
- .ti -1c
- .RI "virtual double \fBscrolledTo\fP (const QPoint &pos) const =0"
- .br
- .RI "Determine the value for a new position of the movable part of the slider\&. "
- .ti -1c
- .RI "void \fBincrementValue\fP (int stepCount)"
- .br
- .ti -1c
- .RI "virtual void \fBscaleChange\fP ()"
- .br
- .ti -1c
- .RI "virtual void \fBsliderChange\fP ()"
- .br
- .RI "Calling update() "
- .ti -1c
- .RI "double \fBincrementedValue\fP (double \fBvalue\fP, int stepCount) const"
- .br
- .in -1c
- .SH "Detailed Description"
- .PP
- An abstract base class for slider widgets with a scale\&.
- A slider widget displays a value according to a scale\&. The class is designed as a common super class for widgets like \fBQwtKnob\fP, \fBQwtDial\fP and \fBQwtSlider\fP\&.
- .PP
- When the slider is nor readOnly() its value can be modified by keyboard, mouse and wheel inputs\&.
- .PP
- The range of the slider is divided into a number of steps from which the value increments according to user inputs depend\&. Only for linear scales the number of steps correspond with a fixed step size\&.
- .SH "Constructor & Destructor Documentation"
- .PP
- .SS "QwtAbstractSlider::QwtAbstractSlider (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
- .PP
- Constructor\&. The scale is initialized to [0\&.0, 100\&.0], the number of steps is set to 100 with 1 and 10 and single an page step sizes\&. Step alignment is enabled\&.
- .PP
- The initial value is invalid\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIparent\fP Parent widget
- .RE
- .PP
- .SH "Member Function Documentation"
- .PP
- .SS "double QwtAbstractSlider::incrementedValue (double value, int stepCount) const\fC [protected]\fP"
- Increment a value
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP Value
- .br
- \fIstepCount\fP Number of steps
- .RE
- .PP
- \fBReturns\fP
- .RS 4
- Incremented value
- .RE
- .PP
- .SS "void QwtAbstractSlider::incrementValue (int stepCount)\fC [protected]\fP"
- Increment the slider
- .PP
- The step size depends on the number of \fBtotalSteps()\fP
- .PP
- \fBParameters\fP
- .RS 4
- \fIstepCount\fP Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetTotalSteps()\fP, \fBincrementedValue()\fP
- .RE
- .PP
- .SS "bool QwtAbstractSlider::invertedControls () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, when the controls are inverted
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetInvertedControls()\fP
- .RE
- .PP
- .SS "bool QwtAbstractSlider::isReadOnly () const"
- In read only mode the slider can't be controlled by mouse or keyboard\&.
- .PP
- \fBReturns\fP
- .RS 4
- true if read only
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetReadOnly()\fP
- .RE
- .PP
- .SS "virtual bool QwtAbstractSlider::isScrollPosition (const QPoint & pos) const\fC [protected]\fP, \fC [pure virtual]\fP"
- .PP
- Determine what to do when the user presses a mouse button\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIpos\fP Mouse position
- .RE
- .PP
- \fBReturn values\fP
- .RS 4
- \fITrue,when\fP pos is a valid scroll position
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBscrolledTo()\fP
- .RE
- .PP
- .PP
- Implemented in \fBQwtSlider\fP, \fBQwtKnob\fP, and \fBQwtDial\fP\&.
- .SS "bool QwtAbstractSlider::isTracking () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, when tracking has been enabled
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetTracking()\fP
- .RE
- .PP
- .SS "bool QwtAbstractSlider::isValid () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, when the value is invalid
- .RE
- .PP
- .SS "void QwtAbstractSlider::keyPressEvent (QKeyEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Handles key events
- .PP
- \fBQwtAbstractSlider\fP handles the following keys:
- .PP
- .IP "\(bu" 2
- Qt::Key_Left
- .br
- Add/Subtract \fBsingleSteps()\fP in direction to \fBlowerBound()\fP;
- .IP "\(bu" 2
- Qt::Key_Right
- .br
- Add/Subtract \fBsingleSteps()\fP in direction to \fBupperBound()\fP;
- .IP "\(bu" 2
- Qt::Key_Down
- .br
- Subtract \fBsingleSteps()\fP, when \fBinvertedControls()\fP is false
- .IP "\(bu" 2
- Qt::Key_Up
- .br
- Add \fBsingleSteps()\fP, when \fBinvertedControls()\fP is false
- .IP "\(bu" 2
- Qt::Key_PageDown
- .br
- Subtract \fBpageSteps()\fP, when \fBinvertedControls()\fP is false
- .IP "\(bu" 2
- Qt::Key_PageUp
- .br
- Add \fBpageSteps()\fP, when \fBinvertedControls()\fP is false
- .IP "\(bu" 2
- Qt::Key_Home
- .br
- Set the value to the \fBminimum()\fP
- .IP "\(bu" 2
- Qt::Key_End
- .br
- Set the value to the \fBmaximum()\fP
- .PP
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Key event
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBisReadOnly()\fP
- .RE
- .PP
- .PP
- Reimplemented in \fBQwtCompass\fP\&.
- .SS "void QwtAbstractSlider::mouseMoveEvent (QMouseEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Mouse Move Event handler
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Mouse event
- .RE
- .PP
- .SS "void QwtAbstractSlider::mousePressEvent (QMouseEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Mouse press event handler
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Mouse event
- .RE
- .PP
- .PP
- Reimplemented in \fBQwtSlider\fP\&.
- .SS "void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Mouse Release Event handler
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Mouse event
- .RE
- .PP
- .PP
- Reimplemented in \fBQwtSlider\fP\&.
- .SS "uint QwtAbstractSlider::pageSteps () const"
- .PP
- \fBReturns\fP
- .RS 4
- Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetPageSteps()\fP, \fBtotalSteps()\fP, \fBsingleSteps()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::scaleChange ()\fC [protected]\fP, \fC [virtual]\fP"
- Update the slider according to modifications of the scale
- .PP
- Reimplemented from \fBQwtAbstractScale\fP\&.
- .PP
- Reimplemented in \fBQwtSlider\fP, and \fBQwtDial\fP\&.
- .SS "virtual double QwtAbstractSlider::scrolledTo (const QPoint & pos) const\fC [protected]\fP, \fC [pure virtual]\fP"
- .PP
- Determine the value for a new position of the movable part of the slider\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIpos\fP Mouse position
- .RE
- .PP
- \fBReturns\fP
- .RS 4
- Value for the mouse position
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBisScrollPosition()\fP
- .RE
- .PP
- .PP
- Implemented in \fBQwtSlider\fP, \fBQwtKnob\fP, and \fBQwtDial\fP\&.
- .SS "void QwtAbstractSlider::setInvertedControls (bool on)"
- Invert wheel and key events
- .PP
- Usually scrolling the mouse wheel 'up' and using keys like page up will increase the slider's value towards its maximum\&. When \fBinvertedControls()\fP is enabled the value is scrolled towards its minimum\&.
- .PP
- Inverting the controls might be f\&.e\&. useful for a vertical slider with an inverted scale ( decreasing from top to bottom )\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP Invert controls, when true
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBinvertedControls()\fP, keyEvent(), \fBwheelEvent()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setPageSteps (uint stepCount)"
- .PP
- Set the number of steps for a page increment\&. The range of the slider is divided into a number of steps from which the value increments according to user inputs depend\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIstepCount\fP Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBpageSteps()\fP, \fBsetTotalSteps()\fP, \fBsetSingleSteps()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setReadOnly (bool on)"
- En/Disable read only mode
- .PP
- In read only mode the slider can't be controlled by mouse or keyboard\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP Enables in case of true
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBisReadOnly()\fP
- .RE
- .PP
- \fBWarning\fP
- .RS 4
- The focus policy is set to Qt::StrongFocus or Qt::NoFocus
- .RE
- .PP
- .SS "void QwtAbstractSlider::setSingleSteps (uint stepCount)"
- .PP
- Set the number of steps for a single increment\&. The range of the slider is divided into a number of steps from which the value increments according to user inputs depend\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIstepCount\fP Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsingleSteps()\fP, \fBsetTotalSteps()\fP, \fBsetPageSteps()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setStepAlignment (bool on)"
- .PP
- Enable step alignment\&. When step alignment is enabled values resulting from slider movements are aligned to the step size\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP Enable step alignment when true
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBstepAlignment()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setTotalSteps (uint stepCount)"
- .PP
- Set the number of steps\&. The range of the slider is divided into a number of steps from which the value increments according to user inputs depend\&.
- .PP
- The default setting is 100\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIstepCount\fP Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBtotalSteps()\fP, \fBsetSingleSteps()\fP, \fBsetPageSteps()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setTracking (bool on)"
- .PP
- Enables or disables tracking\&. If tracking is enabled, the slider emits the \fBvalueChanged()\fP signal while the movable part of the slider is being dragged\&. If tracking is disabled, the slider emits the \fBvalueChanged()\fP signal only when the user releases the slider\&.
- .PP
- Tracking is enabled by default\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP \fCtrue\fP (enable) or \fCfalse\fP (disable) tracking\&.
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBisTracking()\fP, \fBsliderMoved()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setValid (bool on)"
- Set the value to be valid/invalid
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP When true, the value is invalidated
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetValue()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setValue (double value)\fC [slot]\fP"
- Set the slider to the specified value
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP New value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetValid()\fP, \fBsliderChange()\fP, \fBvalueChanged()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::setWrapping (bool on)"
- If wrapping is true stepping up from \fBupperBound()\fP value will take you to the \fBminimum()\fP value and vice versa\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP En/Disable wrapping
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBwrapping()\fP
- .RE
- .PP
- .SS "uint QwtAbstractSlider::singleSteps () const"
- .PP
- \fBReturns\fP
- .RS 4
- Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetSingleSteps()\fP, \fBtotalSteps()\fP, \fBpageSteps()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::sliderMoved (double value)\fC [signal]\fP"
- This signal is emitted when the user moves the slider with the mouse\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP New value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBvalueChanged()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::sliderPressed ()\fC [signal]\fP"
- This signal is emitted when the user presses the movable part of the slider\&.
- .SS "void QwtAbstractSlider::sliderReleased ()\fC [signal]\fP"
- This signal is emitted when the user releases the movable part of the slider\&.
- .SS "bool QwtAbstractSlider::stepAlignment () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, when step alignment is enabled
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetStepAlignment()\fP
- .RE
- .PP
- .SS "uint QwtAbstractSlider::totalSteps () const"
- .PP
- \fBReturns\fP
- .RS 4
- Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetTotalSteps()\fP, \fBsingleSteps()\fP, \fBpageSteps()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::valueChanged (double value)\fC [signal]\fP"
- .PP
- Notify a change of value\&. When tracking is enabled (default setting), this signal will be emitted every time the value changes\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP New value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetTracking()\fP, \fBsliderMoved()\fP
- .RE
- .PP
- .SS "void QwtAbstractSlider::wheelEvent (QWheelEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Wheel Event handler
- .PP
- In/decreases the value by s number of steps\&. The direction depends on the \fBinvertedControls()\fP property\&.
- .PP
- When the control or shift modifier is pressed the wheel delta ( divided by 120 ) is mapped to an increment according to \fBpageSteps()\fP\&. Otherwise it is mapped to \fBsingleSteps()\fP\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Wheel event
- .RE
- .PP
- .PP
- Reimplemented in \fBQwtDial\fP\&.
- .SS "bool QwtAbstractSlider::wrapping () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, when wrapping is set
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetWrapping()\fP
- .RE
- .PP
- .SH "Author"
- .PP
- Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|