#pragma once #include #include class QtLineEditor : public QLineEdit { Q_OBJECT public: //constructor QtLineEditor(QWidget *parent = nullptr); //destructor ~QtLineEditor(); //set a function to init the line edit void init(QString strText, bool isIntOrNot = true,int nMax = 255); //set a function to set the edit target void SetEditTarget(int* nTarget); //and set a overload function to set the edit target void SetEditTarget(QString* strTarget); //set a slot to process the text changed void OnTextChanged(const QString &text); //set a slot to process the text edited void OnTextEdited(const QString &text); public: //set a flags to sign the editor is Int or string bool m_bIsInt; //edit target int* m_nTarget; QString* m_strTarget; };