123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630 |
- .TH "QwtCounter" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
- .ad l
- .nh
- .SH NAME
- QwtCounter \- The Counter Widget\&.
- .SH SYNOPSIS
- .br
- .PP
- .PP
- \fC#include <qwt_counter\&.h>\fP
- .PP
- Inherits QWidget\&.
- .SS "Public Types"
- .in +1c
- .ti -1c
- .RI "enum \fBButton\fP { \fBButton1\fP, \fBButton2\fP, \fBButton3\fP, \fBButtonCnt\fP }"
- .br
- .RI "Button index\&. "
- .in -1c
- .SS "Public Slots"
- .in +1c
- .ti -1c
- .RI "void \fBsetValue\fP (double)"
- .br
- .RI "Set a new value without adjusting to the step raster\&. "
- .in -1c
- .SS "Signals"
- .in +1c
- .ti -1c
- .RI "void \fBbuttonReleased\fP (double \fBvalue\fP)"
- .br
- .ti -1c
- .RI "void \fBvalueChanged\fP (double \fBvalue\fP)"
- .br
- .in -1c
- .SS "Public Member Functions"
- .in +1c
- .ti -1c
- .RI "\fBQwtCounter\fP (QWidget *parent=NULL)"
- .br
- .ti -1c
- .RI "virtual \fB~QwtCounter\fP ()"
- .br
- .RI "Destructor\&. "
- .ti -1c
- .RI "void \fBsetValid\fP (bool)"
- .br
- .ti -1c
- .RI "bool \fBisValid\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetWrapping\fP (bool)"
- .br
- .RI "En/Disable wrapping\&. "
- .ti -1c
- .RI "bool \fBwrapping\fP () const"
- .br
- .ti -1c
- .RI "bool \fBisReadOnly\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetReadOnly\fP (bool)"
- .br
- .RI "Allow/disallow the user to manually edit the value\&. "
- .ti -1c
- .RI "void \fBsetNumButtons\fP (int)"
- .br
- .ti -1c
- .RI "int \fBnumButtons\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetIncSteps\fP (\fBQwtCounter::Button\fP, int numSteps)"
- .br
- .ti -1c
- .RI "int \fBincSteps\fP (\fBQwtCounter::Button\fP) const"
- .br
- .ti -1c
- .RI "virtual QSize \fBsizeHint\fP () const"
- .br
- .RI "A size hint\&. "
- .ti -1c
- .RI "double \fBsingleStep\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetSingleStep\fP (double stepSize)"
- .br
- .RI "Set the step size of the counter\&. "
- .ti -1c
- .RI "void \fBsetRange\fP (double min, double max)"
- .br
- .RI "Set the minimum and maximum values\&. "
- .ti -1c
- .RI "double \fBminimum\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetMinimum\fP (double)"
- .br
- .ti -1c
- .RI "double \fBmaximum\fP () const"
- .br
- .ti -1c
- .RI "void \fBsetMaximum\fP (double)"
- .br
- .ti -1c
- .RI "void \fBsetStepButton1\fP (int nSteps)"
- .br
- .ti -1c
- .RI "int \fBstepButton1\fP () const"
- .br
- .RI "returns the number of increment steps for button 1 "
- .ti -1c
- .RI "void \fBsetStepButton2\fP (int nSteps)"
- .br
- .ti -1c
- .RI "int \fBstepButton2\fP () const"
- .br
- .RI "returns the number of increment steps for button 2 "
- .ti -1c
- .RI "void \fBsetStepButton3\fP (int nSteps)"
- .br
- .ti -1c
- .RI "int \fBstepButton3\fP () const"
- .br
- .RI "returns the number of increment steps for button 3 "
- .ti -1c
- .RI "double \fBvalue\fP () const"
- .br
- .in -1c
- .SS "Protected Member Functions"
- .in +1c
- .ti -1c
- .RI "virtual bool \fBevent\fP (QEvent *)"
- .br
- .ti -1c
- .RI "virtual void \fBwheelEvent\fP (QWheelEvent *)"
- .br
- .ti -1c
- .RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
- .br
- .in -1c
- .SH "Detailed Description"
- .PP
- The Counter Widget\&.
- A Counter consists of a label displaying a number and one ore more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value\&.
- .PP
- A counter has a range from a minimum value to a maximum value and a step size\&. When the wrapping property is set the counter is circular\&.
- .PP
- The number of steps by which a button increments or decrements the value can be specified using \fBsetIncSteps()\fP\&. The number of buttons can be changed with \fBsetNumButtons()\fP\&.
- .PP
- Example:
- .PP
- .nf
- #include <qwt_counter\&.h>
- QwtCounter *counter = new QwtCounter(parent);
- counter->setRange(0\&.0, 100\&.0); // From 0\&.0 to 100
- counter->setSingleStep( 1\&.0 ); // Step size 1\&.0
- counter->setNumButtons(2); // Two buttons each side
- counter->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step
- counter->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps
- connect(counter, SIGNAL(valueChanged(double)), myClass, SLOT(newValue(double)));
- .fi
- .PP
-
- .SH "Member Enumeration Documentation"
- .PP
- .SS "enum \fBQwtCounter::Button\fP"
- .PP
- Button index\&.
- .PP
- \fBEnumerator\fP
- .in +1c
- .TP
- \fB\fIButton1 \fP\fP
- Button intended for minor steps\&.
- .TP
- \fB\fIButton2 \fP\fP
- Button intended for medium steps\&.
- .TP
- \fB\fIButton3 \fP\fP
- Button intended for large steps\&.
- .TP
- \fB\fIButtonCnt \fP\fP
- Number of buttons\&.
- .SH "Constructor & Destructor Documentation"
- .PP
- .SS "QwtCounter::QwtCounter (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
- The counter is initialized with a range is set to [0\&.0, 1\&.0] with 0\&.01 as single step size\&. The value is invalid\&.
- .PP
- The default number of buttons is set to 2\&. The default increments are:
- .PD 0
- .IP "\(bu" 2
- Button 1: 1 step
- .IP "\(bu" 2
- Button 2: 10 steps
- .IP "\(bu" 2
- Button 3: 100 steps
- .PP
- \fBParameters\fP
- .RS 4
- \fIparent\fP
- .RE
- .PP
- .SH "Member Function Documentation"
- .PP
- .SS "void QwtCounter::buttonReleased (double value)\fC [signal]\fP"
- This signal is emitted when a button has been released
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP The new value
- .RE
- .PP
- .SS "bool QwtCounter::event (QEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Handle QEvent::PolishRequest events
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Event
- .RE
- .PP
- \fBReturns\fP
- .RS 4
- see QWidget::event()
- .RE
- .PP
- .SS "int QwtCounter::incSteps (\fBQwtCounter::Button\fP button) const"
- .PP
- \fBReturns\fP
- .RS 4
- The number of steps by which a specified button increments the value or 0 if the button is invalid\&.
- .RE
- .PP
- \fBParameters\fP
- .RS 4
- \fIbutton\fP Button index
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetIncSteps()\fP
- .RE
- .PP
- .SS "bool QwtCounter::isReadOnly () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, when the line line edit is read only\&. (default is no)
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetReadOnly()\fP
- .RE
- .PP
- .SS "bool QwtCounter::isValid () const"
- .PP
- \fBReturns\fP
- .RS 4
- True, if the value is valid
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetValid()\fP, \fBsetValue()\fP
- .RE
- .PP
- .SS "void QwtCounter::keyPressEvent (QKeyEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Handle key events
- .PP
- .IP "\(bu" 2
- Ctrl + Qt::Key_Home
- .br
- Step to \fBminimum()\fP
- .IP "\(bu" 2
- Ctrl + Qt::Key_End
- .br
- Step to \fBmaximum()\fP
- .IP "\(bu" 2
- Qt::Key_Up
- .br
- Increment by incSteps(QwtCounter::Button1)
- .IP "\(bu" 2
- Qt::Key_Down
- .br
- Decrement by incSteps(QwtCounter::Button1)
- .IP "\(bu" 2
- Qt::Key_PageUp
- .br
- Increment by incSteps(QwtCounter::Button2)
- .IP "\(bu" 2
- Qt::Key_PageDown
- .br
- Decrement by incSteps(QwtCounter::Button2)
- .IP "\(bu" 2
- Shift + Qt::Key_PageUp
- .br
- Increment by incSteps(QwtCounter::Button3)
- .IP "\(bu" 2
- Shift + Qt::Key_PageDown
- .br
- Decrement by incSteps(QwtCounter::Button3)
- .PP
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Key event
- .RE
- .PP
- .SS "double QwtCounter::maximum () const"
- .PP
- \fBReturns\fP
- .RS 4
- The maximum of the range
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetRange()\fP, \fBsetMaximum()\fP, \fBminimum()\fP
- .RE
- .PP
- .SS "double QwtCounter::minimum () const"
- .PP
- \fBReturns\fP
- .RS 4
- The minimum of the range
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetRange()\fP, \fBsetMinimum()\fP, \fBmaximum()\fP
- .RE
- .PP
- .SS "int QwtCounter::numButtons () const"
- .PP
- \fBReturns\fP
- .RS 4
- The number of buttons on each side of the widget\&.
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetNumButtons()\fP
- .RE
- .PP
- .SS "void QwtCounter::setIncSteps (\fBQwtCounter::Button\fP button, int numSteps)"
- Specify the number of steps by which the value is incremented or decremented when a specified button is pushed\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIbutton\fP Button index
- .br
- \fInumSteps\fP Number of steps
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBincSteps()\fP
- .RE
- .PP
- .SS "void QwtCounter::setMaximum (double value)"
- Set the maximum value of the range
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP Maximum value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetRange()\fP, \fBsetMinimum()\fP, \fBmaximum()\fP
- .RE
- .PP
- .SS "void QwtCounter::setMinimum (double value)"
- Set the minimum value of the range
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP Minimum value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetRange()\fP, \fBsetMaximum()\fP, \fBminimum()\fP
- .RE
- .PP
- \fBNote\fP
- .RS 4
- The maximum is adjusted if necessary to ensure that the range remains valid\&.
- .RE
- .PP
- .SS "void QwtCounter::setNumButtons (int numButtons)"
- Specify the number of buttons on each side of the label
- .PP
- \fBParameters\fP
- .RS 4
- \fInumButtons\fP Number of buttons
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBnumButtons()\fP
- .RE
- .PP
- .SS "void QwtCounter::setRange (double min, double max)"
- .PP
- Set the minimum and maximum values\&. The maximum is adjusted if necessary to ensure that the range remains valid\&. The value might be modified to be inside of the range\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fImin\fP Minimum value
- .br
- \fImax\fP Maximum value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBminimum()\fP, \fBmaximum()\fP
- .RE
- .PP
- .SS "void QwtCounter::setReadOnly (bool on)"
- .PP
- Allow/disallow the user to manually edit the value\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP True disable editing
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBisReadOnly()\fP
- .RE
- .PP
- .SS "void QwtCounter::setSingleStep (double stepSize)"
- .PP
- Set the step size of the counter\&. A value <= 0\&.0 disables stepping
- .PP
- \fBParameters\fP
- .RS 4
- \fIstepSize\fP Single step size
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsingleStep()\fP
- .RE
- .PP
- .SS "void QwtCounter::setStepButton1 (int nSteps)"
- Set the number of increment steps for button 1
- .PP
- \fBParameters\fP
- .RS 4
- \fInSteps\fP Number of steps
- .RE
- .PP
- .SS "void QwtCounter::setStepButton2 (int nSteps)"
- Set the number of increment steps for button 2
- .PP
- \fBParameters\fP
- .RS 4
- \fInSteps\fP Number of steps
- .RE
- .PP
- .SS "void QwtCounter::setStepButton3 (int nSteps)"
- Set the number of increment steps for button 3
- .PP
- \fBParameters\fP
- .RS 4
- \fInSteps\fP Number of steps
- .RE
- .PP
- .SS "void QwtCounter::setValid (bool on)"
- Set the counter to be in valid/invalid state
- .PP
- When the counter is set to invalid, no numbers are displayed and the buttons are disabled\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIon\fP If true the counter will be set as valid
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetValue()\fP, \fBisValid()\fP
- .RE
- .PP
- .SS "void QwtCounter::setValue (double value)\fC [slot]\fP"
- .PP
- Set a new value without adjusting to the step raster\&. The state of the counter is set to be valid\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP New value
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBisValid()\fP, \fBvalue()\fP, \fBvalueChanged()\fP
- .RE
- .PP
- \fBWarning\fP
- .RS 4
- The value is clipped when it lies outside the range\&.
- .RE
- .PP
- .SS "void QwtCounter::setWrapping (bool on)"
- .PP
- En/Disable wrapping\&. If wrapping is true stepping up from \fBmaximum()\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 "double QwtCounter::singleStep () const"
- .PP
- \fBReturns\fP
- .RS 4
- Single step size
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetSingleStep()\fP
- .RE
- .PP
- .SS "double QwtCounter::value () const"
- .PP
- \fBReturns\fP
- .RS 4
- Current value of the counter
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetValue()\fP, \fBvalueChanged()\fP
- .RE
- .PP
- .SS "void QwtCounter::valueChanged (double value)\fC [signal]\fP"
- This signal is emitted when the counter's value has changed
- .PP
- \fBParameters\fP
- .RS 4
- \fIvalue\fP The new value
- .RE
- .PP
- .SS "void QwtCounter::wheelEvent (QWheelEvent * event)\fC [protected]\fP, \fC [virtual]\fP"
- Handle wheel events
- .PP
- \fBParameters\fP
- .RS 4
- \fIevent\fP Wheel event
- .RE
- .PP
- .SS "bool QwtCounter::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\&.
|