2015-07-26 21:39:49 +00:00
|
|
|
#ifndef WDRAGGABLESPINBOX_H
|
|
|
|
#define WDRAGGABLESPINBOX_H
|
|
|
|
|
|
|
|
#include <QDoubleSpinBox>
|
|
|
|
|
|
|
|
class WDraggableSpinBox : public QDoubleSpinBox
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
bool mBeingDragged;
|
|
|
|
bool mBeenDragged;
|
|
|
|
double mDefaultValue;
|
2015-07-29 03:19:25 +00:00
|
|
|
int mLastY;
|
2015-08-22 13:43:42 +00:00
|
|
|
int mMinDecimals;
|
|
|
|
bool mTrimTrailingZeroes;
|
2015-07-26 21:39:49 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit WDraggableSpinBox(QWidget *parent = 0);
|
|
|
|
~WDraggableSpinBox();
|
2015-07-29 04:41:23 +00:00
|
|
|
void mousePressEvent(QMouseEvent *pEvent);
|
|
|
|
void mouseReleaseEvent(QMouseEvent *pEvent);
|
|
|
|
void mouseMoveEvent(QMouseEvent *pEvent);
|
|
|
|
void wheelEvent(QWheelEvent *pEvent);
|
2015-07-30 03:53:24 +00:00
|
|
|
bool eventFilter(QObject *pObj, QEvent *pEvent);
|
2015-08-22 13:43:42 +00:00
|
|
|
QString textFromValue(double val) const;
|
2015-08-25 01:17:15 +00:00
|
|
|
bool IsBeingDragged();
|
2015-07-29 13:51:59 +00:00
|
|
|
void SetDefaultValue(double value);
|
2015-08-22 13:43:42 +00:00
|
|
|
void SetMinDecimals(int dec);
|
|
|
|
void TrimTrailingZeroes(bool trim);
|
2015-07-26 21:39:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WDRAGGABLESPINBOX_H
|