PrimeWorldEditor/UI/WDraggableSpinBox.h

32 lines
833 B
C
Raw Normal View History

#ifndef WDRAGGABLESPINBOX_H
#define WDRAGGABLESPINBOX_H
#include <QDoubleSpinBox>
class WDraggableSpinBox : public QDoubleSpinBox
{
Q_OBJECT
bool mBeingDragged;
bool mBeenDragged;
double mDefaultValue;
int mLastY;
2015-08-22 13:43:42 +00:00
int mMinDecimals;
bool mTrimTrailingZeroes;
public:
explicit WDraggableSpinBox(QWidget *parent = 0);
~WDraggableSpinBox();
void mousePressEvent(QMouseEvent *pEvent);
void mouseReleaseEvent(QMouseEvent *pEvent);
void mouseMoveEvent(QMouseEvent *pEvent);
void wheelEvent(QWheelEvent *pEvent);
bool eventFilter(QObject *pObj, QEvent *pEvent);
2015-08-22 13:43:42 +00:00
QString textFromValue(double val) const;
bool IsBeingDragged();
void SetDefaultValue(double value);
2015-08-22 13:43:42 +00:00
void SetMinDecimals(int dec);
void TrimTrailingZeroes(bool trim);
};
#endif // WDRAGGABLESPINBOX_H