-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpasswordcontrol.h
40 lines (37 loc) · 1007 Bytes
/
passwordcontrol.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
#ifndef PASSWORDCONTROL_H
#define PASSWORDCONTROL_H
#include <QWidget>
#include <QHBoxLayout>
#include <QLabel>
#include <QSlider>
#include <QSpinBox>
#include <QRadioButton>
#include <QPushButton>
#include <QButtonGroup>
#include "password.h"
class PasswordControl : public QWidget
{
Q_OBJECT
public:
explicit PasswordControl(QWidget *parent = nullptr);
void setDefault(int length=6, CodeType codeType=wubi);
private:
QVBoxLayout *vBox;
QHBoxLayout *codeTypeHBox;
QLabel *codeTypeLabel;
QRadioButton *codeWubiButton, *codePinyinButton;
QButtonGroup *codeTypeButtons;
QHBoxLayout *lengthHBox;
QLabel *lengthLabel;
QSlider *lengthSlider;
QSpinBox *lengthSpinBox;
QPushButton *genButton;
private slots:
void changeLength(int length);
void changeType(int codeType, bool checked=true);
signals:
void lengthChanged(int length);
void typeChanged(CodeType codeType);
void request();
};
#endif // PASSWORDCONTROL_H