QwtCounter(3)
QwtCounter(3) π β Library Functions Manual β¨
okay bestie, welcome to the Library Functions Manual page for QwtCounter β literally the Counter Widget. itβs giving βnumber go up, number go downβ but make it Qt π
πΈ NAME πΈ
QwtCounter β The Counter Widget.
β¨ SYNOPSIS β¨
#include <qwt_counter.h>
Inherits QWidget.
π Public Types π
enum Button { Button1, Button2, Button3, ButtonCnt }β Button index.
π Public Slots π
void setValue (double)β Set a new value without adjusting to the step raster.
π«Ά Signals π«Ά
void buttonReleased (double value)void valueChanged (double value)
π Public Member Functions π
QwtCounter (QWidget *parent=NULL)virtual ~QwtCounter ()β Destructor.void setValid (bool)bool isValid () constvoid setWrapping (bool)β En/Disable wrapping.bool wrapping () constbool isReadOnly () constvoid setReadOnly (bool)β Allow/disallow the user to manually edit the value.void setNumButtons (int)int numButtons () constvoid setIncSteps (QwtCounter::Button, int numSteps)int incSteps (QwtCounter::Button) constvirtual QSize sizeHint () const overrideβ A size hint.double singleStep () constvoid setSingleStep (double stepSize)β Set the step size of the counter.void setRange (double min, double max)β Set the minimum and maximum values.double minimum () constvoid setMinimum (double)double maximum () constvoid setMaximum (double)void setStepButton1 (int nSteps)int stepButton1 () constβ returns the number of increment steps for button 1void setStepButton2 (int nSteps)int stepButton2 () constβ returns the number of increment steps for button 2void setStepButton3 (int nSteps)int stepButton3 () constβ returns the number of increment steps for button 3double value () const
π§ Protected Member Functions π§
virtual bool event (QEvent *) overridevirtual void wheelEvent (QWheelEvent *) overridevirtual void keyPressEvent (QKeyEvent *) override
π Detailed Description π
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, and those buttons 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. When the wrapping property is set, the counter is circular. π
The number of steps by which a button increments or decrements the value can be specified using setIncSteps(). The number of buttons can be changed with setNumButtons().
Example:
#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)));
Definition at line 48 of file qwt_counter.h.
π Member Enumeration Documentation π
enum QwtCounter::Button
Button index.
Enumerator:
Button1β Button intended for minor steps.Button2β Button intended for medium steps.Button3β Button intended for large steps.ButtonCntβ Number of buttons.
Definition at line 67 of file qwt_counter.h.
πΈ Constructor & Destructor Documentation πΈ
QwtCounter::QwtCounter (QWidget * parent = NULL) [explicit]
The counter is initialized with a range set to [0.0, 1.0] with 0.01 as single step size. The value is invalid.
The default number of buttons is set to 2. The default increments are:
- Button 1:
1step - Button 2:
10steps - Button 3:
100steps
Parameters
parent
Definition at line 65 of file qwt_counter.cpp.
QwtCounter::~QwtCounter () [virtual]
Destructor.
Definition at line 127 of file qwt_counter.cpp.
π MEMBER FUNCTION DOCUMENTATION π
okay bestie, this is the member-function part of the page, and it is stacked β every function, every line number, every little βsee alsoβ is coming with us. no cap π
π
void QwtCounter::buttonReleased (double value) [signal]
This signal is emitted when a button has been released π
- Parameters:
valueβ The new value
πΈ bool QwtCounter::event (QEvent * event) [override], [protected], [virtual]
Handle QEvent::PolishRequest events β¨
- Parameters:
eventβ Event - Returns: see
QWidget::event()
π Definition at line 485 of file qwt_counter.cpp.
π¦ int QwtCounter::incSteps (QwtCounter::Button button) const
- Returns: The number of steps by which a specified button increments the value or
0if the button is invalid. - Parameters:
buttonβ Button index
See also: setIncSteps()
π Definition at line 416 of file qwt_counter.cpp.
π bool QwtCounter::isReadOnly () const
- Returns:
True, when the line line edit is read only. (default is no)
See also: setReadOnly()
π Definition at line 186 of file qwt_counter.cpp.
β¨ bool QwtCounter::isValid () const
- Returns:
True, if the value is valid
See also: setValid(), setValue()
π Definition at line 166 of file qwt_counter.cpp.
π§ void QwtCounter::keyPressEvent (QKeyEvent * event) [override], [protected], [virtual]
Handle key events, bestie β these are the keyboard shortcuts and they are very specific π
- Ctrl +
Qt::Key_Homeβ Step tominimum() - Ctrl +
Qt::Key_Endβ Step tomaximum() Qt::Key_Upβ Increment byincSteps(QwtCounter::Button1)Qt::Key_Downβ Decrement byincSteps(QwtCounter::Button1)Qt::Key_PageUpβ Increment byincSteps(QwtCounter::Button2)Qt::Key_PageDownβ Decrement byincSteps(QwtCounter::Button2)- Shift +
Qt::Key_PageUpβ Increment byincSteps(QwtCounter::Button3) - Shift +
Qt::Key_PageDownβ Decrement byincSteps(QwtCounter::Button3) - Parameters:
eventβ Key event
π Definition at line 524 of file qwt_counter.cpp.
π double QwtCounter::maximum () const
- Returns: The maximum of the range
See also: setRange(), setMaximum(), minimum()
π Definition at line 306 of file qwt_counter.cpp.
π double QwtCounter::minimum () const
- Returns: The minimum of the range
See also: setRange(), setMinimum(), maximum()
π Definition at line 286 of file qwt_counter.cpp.
π«Ά int QwtCounter::numButtons () const
- Returns: The number of buttons on each side of the widget.
See also: setNumButtons()
π Definition at line 388 of file qwt_counter.cpp.
π void QwtCounter::setIncSteps (QwtCounter::Button button, int numSteps)
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed, fr fr β¨
- Parameters:
buttonβ Button index - Parameters:
numStepsβ Number of steps
See also: incSteps()
π Definition at line 403 of file qwt_counter.cpp.
π₯ void QwtCounter::setMaximum (double value)
Set the maximum value of the range π
- Parameters:
valueβ Maximum value
See also: setRange(), setMinimum(), maximum()
π Definition at line 297 of file qwt_counter.cpp.
πΈ void QwtCounter::setMinimum (double value)
Set the minimum value of the range π
- Parameters:
valueβ Minimum value
See also: setRange(), setMaximum(), minimum()
Note: The maximum is adjusted if necessary to ensure that the range remains valid.
π Definition at line 277 of file qwt_counter.cpp.
π¦ void QwtCounter::setNumButtons (int numButtons)
Specify the number of buttons on each side of the label β¨
- Parameters:
numButtonsβ Number of buttons
See also: numButtons()
π Definition at line 362 of file qwt_counter.cpp.
π void QwtCounter::setRange (double min, double max)
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 π
- Parameters:
minβ Minimum value - Parameters:
maxβ Maximum value
See also: minimum(), maximum()
π Definition at line 241 of file qwt_counter.cpp.
π void QwtCounter::setReadOnly (bool on)
Allow/disallow the user to manually edit the value. main character control energy π«Ά
- Parameters:
onβTruedisable editing
See also: isReadOnly()
π Definition at line 177 of file qwt_counter.cpp.
β void QwtCounter::setSingleStep (double stepSize)
Set the step size of the counter. A value <= 0.0 disables stepping, so be careful with that one π¨
- Parameters:
stepSizeβ Single step size
See also: singleStep()
π Definition at line 319 of file qwt_counter.cpp.
π void QwtCounter::setStepButton1 (int nSteps)
Set the number of increment steps for button 1 π
- Parameters:
nStepsβ Number of steps
π Definition at line 429 of file qwt_counter.cpp.
π§ void QwtCounter::setStepButton2 (int nSteps)
Set the number of increment steps for button 2 β¨
- Parameters:
nStepsβ Number of steps
π Definition at line 444 of file qwt_counter.cpp.
π void QwtCounter::setStepButton3 (int nSteps)
Set the number of increment steps for button 3 π
- Parameters:
nStepsβ Number of steps
π Definition at line 459 of file qwt_counter.cpp.
π void QwtCounter::setValid (bool on)
Set the counter to be in valid/invalid state β¨
When the counter is set to invalid, no numbers are displayed and the buttons are disabled. itβs giving βghosted but make it UIβ π
- Parameters:
onβ If true the counter will be set as valid
See also: setValue(), isValid()
π Definition at line 142 of file qwt_counter.cpp.
π void QwtCounter::setValue (double value) [slot]
Set a new value without adjusting to the step raster. The state of the counter is set to be valid π
- Parameters:
valueβ New value
See also: isValid(), value(), valueChanged()
Warning: The value is clipped when it lies outside the range.
π Definition at line 202 of file qwt_counter.cpp.
π void QwtCounter::setWrapping (bool on)
En/Disable wrapping. If wrapping is true stepping up from maximum() value will take you to the minimum() value and vice versa πβ¨
- Parameters:
onβ En/Disable wrapping
See also: wrapping()
π Definition at line 342 of file qwt_counter.cpp.
π«Ά double QwtCounter::singleStep () const
- Returns: Single step size
See also: setSingleStep()
π Definition at line 328 of file qwt_counter.cpp.
π
QSize QwtCounter::sizeHint () const [override], [virtual]
A size hint π
π Definition at line 759 of file qwt_counter.cpp.
β¨ int QwtCounter::stepButton1 () const
returns the number of increment steps for button 1
π Definition at line 435 of file qwt_counter.cpp.
πΈ int QwtCounter::stepButton2 () const
returns the number of increment steps for button 2
π Definition at line 450 of file qwt_counter.cpp.
π¦ int QwtCounter::stepButton3 () const
returns the number of increment steps for button 3
π Definition at line 465 of file qwt_counter.cpp.
π double QwtCounter::value () const
- Returns: Current value of the counter
See also: setValue(), valueChanged()
π Definition at line 225 of file qwt_counter.cpp.
π₯ void QwtCounter::valueChanged (double value) [signal]
This signal is emitted when the counter's value has changed π
- Parameters:
valueβ The new value
π§ void QwtCounter::wheelEvent (QWheelEvent * event) [override], [protected], [virtual]
Handle wheel events, bestie β the scroll wheel said βi have loreβ π
- Parameters:
eventβ Wheel event
π Definition at line 591 of file qwt_counter.cpp.
π bool QwtCounter::wrapping () const
- Returns:
True, when wrapping is set
See also: setWrapping()
π Definition at line 351 of file qwt_counter.cpp.
πΈ AUTHOR πΈ
Generated automatically by Doxygen for Qwt User's Guide from the source code.
and thatβs the page, bestie π big cute sign-off to the Qwt User's Guide source/version and the QwtCounter(3) page β date: whatever the footer says, mwah πβ¨
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms