qt/LedOK/base/qiplineedit.h

38 lines
894 B
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
#ifndef QIPLINEEDIT_H
#define QIPLINEEDIT_H
#include <QLineEdit>
#include <QEvent>
#include <QHBoxLayout>
2022-08-25 18:37:24 +08:00
class QIPLineEdit : public QLineEdit {
2022-01-04 18:11:48 +08:00
Q_OBJECT
public:
QIPLineEdit(QWidget *parent = nullptr);
~QIPLineEdit();
void setText(const QString &strIP);
QString text() const;
void MyClear();
void MySetColor(QColor cr);
protected:
void paintEvent(QPaintEvent *event);
bool eventFilter(QObject *obj, QEvent *ev);
int getIndex(QLineEdit *pEdit);
bool isTextValid(const QString &strIP);
protected slots:
void OnLineEdit1TextChanged(const QString & strtemp);
void OnLineEdit2TextChanged(const QString & strtemp);
void OnLineEdit3TextChanged(const QString & strtemp);
void OnLineEdit4TextChanged(const QString & strtemp);
private:
QLineEdit *m_lineEidt[4];
QHBoxLayout *pHBox;
QColor m_Color;
};
#endif // QIPLINEEDIT_H