-
Notifications
You must be signed in to change notification settings - Fork 0
/
ipaddress.h
69 lines (52 loc) · 1.52 KB
/
ipaddress.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef IPADDRESS_H
#define IPADDRESS_H
/*bowwowed from github -> MULan (?) License...
me no speaks Mandarin,or orange....
*/
#include <QWidget>
class QLabel;
class QLineEdit;
#ifdef quc
class Q_DECL_EXPORT IPAddress : public QWidget
#else
class IPAddress : public QWidget
#endif
{
Q_OBJECT
Q_PROPERTY(QString ip READ getIP WRITE setIP)
public:
explicit IPAddress(QWidget *parent = 0);
protected:
bool eventFilter(QObject *watched, QEvent *event);
private:
QLabel *labDot1; //第一个小圆点
QLabel *labDot2; //第二个小圆点
QLabel *labDot3; //第三个小圆点
QLineEdit *txtIP1; //IP地址网段输入框1
QLineEdit *txtIP2; //IP地址网段输入框2
QLineEdit *txtIP3; //IP地址网段输入框3
QLineEdit *txtIP4; //IP地址网段输入框4
QString ip; //IP地址
QString bgColor; //背景颜色
QString borderColor;//边框颜色
int borderRadius; //边框圆角角度
private slots:
void textChanged(const QString &text);
public:
//获取IP地址
QString getIP() const;
QSize sizeHint() const;
QSize minimumSizeHint() const;
public Q_SLOTS:
//设置IP地址
void setIP(const QString &ip);
//清空
void clear();
//设置背景颜色
void setBgColor(const QString &bgColor);
//设置边框颜色
void setBorderColor(const QString &borderColor);
//设置边框圆角角度
void setBorderRadius(int borderRadius);
};
#endif // IPADDRESS_H