summaryrefslogtreecommitdiff
path: root/widgets/RestrictedSpinBox.hpp
blob: e984c37708fed0a6765c2fb70a7d7f630b545bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef RESTRICTED_SPIN_BOX_HPP_
#define RESTRICTED_SPIN_BOX_HPP_

#include "HintedSpinBox.hpp"

class QString;

//
// RestrictedSpinBox - select only from a sequence of values
//
class RestrictedSpinBox final
  : public HintedSpinBox
{
public:
  RestrictedSpinBox (QWidget * parent = nullptr)
    : HintedSpinBox {parent}
  {
  }

protected:
  // override the base class validation
  QValidator::State validate (QString& input, int& pos) const override;
  void fixup (QString& input) const override;
};

#endif