#ifndef QIPLINEEDIT_H #define QIPLINEEDIT_H #include #include #include class QIPLineEdit : public QLineEdit { 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