qwt_counter.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_COUNTER_H
#define QWT_COUNTER_H
#include "qwt_global.h"
#include <qwidget.h>
class QWT_EXPORT QwtCounter : public QWidget
{
Q_OBJECT
Q_PROPERTY( double value READ value WRITE setValue NOTIFY valueChanged USER true )
Q_PROPERTY( double minimum READ minimum WRITE setMinimum )
Q_PROPERTY( double maximum READ maximum WRITE setMaximum )
Q_PROPERTY( double singleStep READ singleStep WRITE setSingleStep )
Q_PROPERTY( int numButtons READ numButtons WRITE setNumButtons )
Q_PROPERTY( int stepButton1 READ stepButton1 WRITE setStepButton1 )
Q_PROPERTY( int stepButton2 READ stepButton2 WRITE setStepButton2 )
Q_PROPERTY( int stepButton3 READ stepButton3 WRITE setStepButton3 )
Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping )
public:
enum Button
{
Button1,
Button2,
Button3,
ButtonCnt
};
explicit QwtCounter( QWidget* parent = NULL );
virtual ~QwtCounter();
void setValid( bool );
bool isValid() const;
void setWrapping( bool );
bool wrapping() const;
bool isReadOnly() const;
void setReadOnly( bool );
void setNumButtons( int );
int numButtons() const;
void setIncSteps( QwtCounter::Button, int numSteps );
int incSteps( QwtCounter::Button ) const;
virtual QSize sizeHint() const QWT_OVERRIDE;
double singleStep() const;
void setSingleStep( double stepSize );
void setRange( double min, double max );
double minimum() const;
void setMinimum( double );
double maximum() const;
void setMaximum( double );
void setStepButton1( int nSteps );
int stepButton1() const;
void setStepButton2( int nSteps );
int stepButton2() const;
void setStepButton3( int nSteps );
int stepButton3() const;
double value() const;
public Q_SLOTS:
void setValue( double );
Q_SIGNALS:
void buttonReleased ( double value );
void valueChanged ( double value );
protected:
virtual bool event( QEvent* ) QWT_OVERRIDE;
virtual void wheelEvent( QWheelEvent* ) QWT_OVERRIDE;
virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
private Q_SLOTS:
void btnReleased();
void btnClicked();
void textChanged();
private:
void incrementValue( int numSteps );
void initCounter();
void updateButtons();
void showNumber( double );
class PrivateData;
PrivateData* m_data;
};
#endif
QwtCounter
The Counter Widget.
Definition: qwt_counter.h:49
QwtCounter::Button
Button
Button index.
Definition: qwt_counter.h:68
QwtCounter::Button1
@ Button1
Button intended for minor steps.
Definition: qwt_counter.h:70
QwtCounter::Button3
@ Button3
Button intended for large steps.
Definition: qwt_counter.h:76
QwtCounter::Button2
@ Button2
Button intended for medium steps.
Definition: qwt_counter.h:73