-
Notifications
You must be signed in to change notification settings - Fork 0
/
validatordemo.h
52 lines (44 loc) · 1.21 KB
/
validatordemo.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef VALIDATORDEMO_H
#define VALIDATORDEMO_H
#include <QWidget>
#include <QLineEdit>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGroupBox>
#include <QRadioButton>
#include <QRegularExpressionValidator>
#include <QRegularExpression>
#include <QLocale>
#include "signalindicator.h"
class ValidatorDemo : public QWidget
{
Q_OBJECT
public:
explicit ValidatorDemo(QWidget *parent = nullptr);
private:
QLineEdit *lineEdit, *txtMaxVal;
QRadioButton *radIntValid;
QRadioButton *radDoubleValidUs;
QRadioButton *radDoubleValidDe;
QRadioButton *radRegExValid;
QRadioButton *radNoValid;
QLabel *lblMaxVal;
SignalIndicator *sigindEditingFinished, *sigindReturnPressed;
QIntValidator *validInt;
QDoubleValidator *validDoubleUs;
QDoubleValidator *validDoubleDe;
QRegularExpressionValidator *validRegEx;
private:
void setupWidgets();
void setupValidators();
void setupLayout();
private slots:
void onIntValidSel(bool checked);
void onDoubleUsValidSel(bool checked);
void onDoubleDeValidSel(bool checked);
void onRegExValidSel(bool checked);
void onNoValidSel(bool checked);
void onMaxLenChange();
};
#endif // VALIDATORDEMO_H