DoubleSpinBox.h 465 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <QObject>
  3. #include <QDoubleSpinBox>
  4. class DoubleSpinBox : public QDoubleSpinBox
  5. {
  6. Q_OBJECT
  7. public:
  8. DoubleSpinBox(QWidget *parent = nullptr);
  9. ~DoubleSpinBox();
  10. virtual bool eventFilter(QObject *watched, QEvent *event) override;
  11. void setEditColor();
  12. void setSavedColor();
  13. void setValue(double val);
  14. signals:
  15. void editDone();
  16. private:
  17. QLineEdit* m_lineEdit{ nullptr };
  18. bool m_valueChangeFalg = false;
  19. double m_oldVal = -1;
  20. };