QwtCounter(3)
π QwtCounter(3) β Qwt User's Guide π
okay bestie, welcome to the QwtCounter(3) page from the Qwt User's Guide. It's giving counter widget, it's giving slay, and we're gonna go through every single detail together. no cap. π
β¨ NAME β¨
QwtCounter - (the description is blank in the original, iykyk)
β¨ SYNOPSIS β¨
#include <qwt_counter.h>
Inherits QwtDoubleRange.
π¦ Public Types π¦
enum Button { Button1, Button2, Button3, ButtonCnt }
π£ Signals π£
void buttonReleased (double value)
void valueChanged (double value)
π Public Member Functions π
QwtCounter (QWidget *parent=NULL)
virtual ~QwtCounter ()
bool editable () const
int incSteps (QwtCounter::Button btn) const
double maxVal () const
double minVal () const
int numButtons () const
virtual void polish ()
void setEditable (bool)
void setIncSteps (QwtCounter::Button btn, int nSteps)
void setMaxValue (double m)
void setMinValue (double m)
void setNumButtons (int n)
void setStep (double s)
void setStepButton1 (int nSteps)
void setStepButton2 (int nSteps)
void setStepButton3 (int nSteps)
virtual void setValue (double)
virtual QSize sizeHint () const
double step () const
int stepButton1 () const
int stepButton2 () const
int stepButton3 () const
virtual double value () const
π‘οΈ Protected Member Functions π‘οΈ
virtual bool event (QEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void rangeChange ()
virtual void wheelEvent (QWheelEvent *)
πΈ Detailed Description πΈ
The Counter Widget. slay β¨
A Counter consists of a label displaying a number and one or more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value.
A Counter has a range from a minimum value to a maximum value and a step size. The range can be specified using QwtDblRange::setRange(). The counter's value is an integer multiple of the step size. The number of steps by which a button increments or decrements the value can be specified using QwtCounter::setIncSteps(). The number of buttons can be changed with QwtCounter::setNumButtons().
Holding the space bar down with focus on a button is the fastest method to step through the counter values. When the counter underflows/overflows, the focus is set to the smallest up/down button and counting is disabled. Counting is re-enabled on a button release event (mouse or space bar).
Example:
#include '../include/qwt_counter.h>
QwtCounter *cnt;
cnt = new QwtCounter(parent, name);
cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0
cnt->setNumButtons(2); // Two buttons each side
cnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step
cnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps
connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));
π Member Enumeration Documentation π
enum QwtCounter::Button
Button index. The values are Button1, Button2, Button3, ButtonCnt β they're up in the Public Types section too, bestie. π¦
π¦ Constructor & Destructor Documentation π¦
QwtCounter::QwtCounter (QWidget *parent = NULL) [explicit]
The default number of buttons is set to 2. The default increments are:
Button 1:1stepButton 2:10stepsButton 3:100steps
Parameters:
parent
(The destructor virtual ~QwtCounter() is listed in the synopsis above; the original docs don't give it a separate paragraph, so we're not inventing one. π
)
π Member Function Documentation π
void QwtCounter::buttonReleased (doublevalue) [signal]
This signal is emitted when a button has been released.
Parameters:
valueThe new value
bool QwtCounter::event (QEvent *e) [protected], [virtual]
Handle PolishRequest events.
int QwtCounter::incSteps (QwtCounter::Buttonbtn) const
Returns: the number of steps by which a specified button increments the value or 0 if the button is invalid.
Parameters:
btnOne ofQwtCounter::Button1,QwtCounter::Button2,QwtCounter::Button3
void QwtCounter::keyPressEvent (QKeyEvent *e) [protected], [virtual]
Handle key events
Ctrl + Qt::Key_HomeStep tominValue()Ctrl + Qt::Key_EndStep tomaxValue()Qt::Key_UpIncrement byincSteps(QwtCounter::Button1)Qt::Key_DownDecrement byincSteps(QwtCounter::Button1)Qt::Key_PageUpIncrement byincSteps(QwtCounter::Button2)Qt::Key_PageDownDecrement byincSteps(QwtCounter::Button2)Shift + Qt::Key_PageUpIncrement byincSteps(QwtCounter::Button3)Shift + Qt::Key_PageDownDecrement byincSteps(QwtCounter::Button3)
int QwtCounter::numButtons () const
Returns: The number of buttons on each side of the widget.
void QwtCounter::polish () [virtual]
Sets the minimum width for the buttons.
void QwtCounter::rangeChange () [protected], [virtual]
Notify change of range. This function updates the enabled property of all buttons contained in QwtCounter.
Reimplemented from QwtDoubleRange.
void QwtCounter::setEditable (booleditable)
Allow/disallow the user to manually edit the value.
Parameters:
editabletrueenables editing
See also: editable()
void QwtCounter::setIncSteps (QwtCounter::Buttonbtn, intnSteps)
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
Parameters:
btnOne ofQwtCounter::Button1,QwtCounter::Button2,QwtCounter::Button3nStepsNumber of steps
void QwtCounter::setMaxValue (doublevalue)
Set the maximum value of the range
Parameters:
valueMaximum value
See also: setMinValue(), maxVal()
void QwtCounter::setMinValue (doublevalue)
Set the minimum value of the range
Parameters:
valueMinimum value
See also: setMaxValue(), minVal()
void QwtCounter::setNumButtons (intn)
Specify the number of buttons on each side of the label.
Parameters:
nNumber of buttons
void QwtCounter::setStep (doublestepSize)
Set the step size
Parameters:
stepSizeStep size
See also: QwtDoubleRange::setStep()
Reimplemented from QwtDoubleRange.
void QwtCounter::setStepButton1 (intnSteps)
Set the number of increment steps for button 1
Parameters:
nStepsNumber of steps
void QwtCounter::setStepButton2 (intnSteps)
Set the number of increment steps for button 2
Parameters:
nStepsNumber of steps
void QwtCounter::setStepButton3 (intnSteps)
Set the number of increment steps for button 3
Parameters:
nStepsNumber of steps
void QwtCounter::setValue (doublev) [virtual]
Set a new value.
Parameters:
vnew value CallsQwtDoubleRange::setValueand does all visual updates.
See also: QwtDoubleRange::setValue()
Reimplemented from QwtDoubleRange.
double QwtCounter::value () const [virtual]
Returns: Current value
Reimplemented from QwtDoubleRange.
void QwtCounter::valueChanged (doublevalue) [signal]
This signal is emitted when the counter's value has changed
Parameters:
valueThe new value
void QwtCounter::wheelEvent (QWheelEvent *e) [protected], [virtual]
Handle wheel events
Parameters:
eWheel event
π Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code. no cap, the robots wrote this one. π
Version5.2.3βTue Nov 20 2012βQwtCounter(3)π bye bestie, go slay with your counter! π
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms