fw4spl
QHexSpinBox.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWDICOMIOFILTERQT_WIDGET_QHEXSPINBOX_HPP__
8 #define __FWDICOMIOFILTERQT_WIDGET_QHEXSPINBOX_HPP__
9 
10 #include "fwDicomIOFilterQt/config.hpp"
11 
12 #include <QRegExpValidator>
13 #include <QSpinBox>
14 #include <QWidget>
15 
16 namespace fwDicomIOFilterQt
17 {
18 namespace widget
19 {
20 
24 class QHexSpinBox : public QSpinBox
25 {
26 Q_OBJECT;
27 
28 public:
30  QHexSpinBox(QWidget* parent = 0);
31 
32 protected:
34  QValidator::State validate(QString& text, int& pos) const;
35 
37  int valueFromText(const QString& text) const;
38 
40  QString textFromValue(int value) const;
41 
42 
43  QRegExpValidator* m_validator;
44 
45 
46 };
47 
48 } // namespace widget
49 } // namespace fwDicomIOFilterQt
50 
51 
52 #endif /* __FWDICOMIOFILTERQT_WIDGET_QHEXSPINBOX_HPP__ */
QString textFromValue(int value) const
Override.
Definition: QHexSpinBox.cpp:40
int valueFromText(const QString &text) const
Override.
Definition: QHexSpinBox.cpp:32
QSpinBox for hexadecimal values.
Definition: QHexSpinBox.hpp:24
QValidator::State validate(QString &text, int &pos) const
Override.
Definition: QHexSpinBox.cpp:25
fwDicomIOFilterQt contains filters used to pre-process images before reading.
QHexSpinBox(QWidget *parent=0)
Constructor.
Definition: QHexSpinBox.cpp:17