HexSpinBox.h 449 Bytes
Newer Older
oberion's avatar
oberion committed
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
#ifndef HEXSPINBOX_H_
#define HEXSPINBOX_H_

#include <qspinbox.h>

class QRegExpValidator;

class HexSpinBox : public QSpinBox
{
    Q_OBJECT
public:
    HexSpinBox(QWidget *parent = 0);
	~HexSpinBox(void);

protected:
    QValidator::State validate(QString &text, int &pos) const;
    int valueFromText(const QString &text) const;
    QString textFromValue(int value) const;

private:
    QRegExpValidator *validator;
};

#endif // HEXSPINBOX_H_