#ifndef CUILINEEDIT_H #define CUILINEEDIT_H #include #include #include "CUIPropertyAPI.h" #include "CUIComponentBase.h" #include "CUIComponentBaseWidget.h" class CUIConfig; class QLabel; class QHBoxLayout; class CUI; class CUIPropertyAPI CUILineEdit : public CUIComponentBaseWidget, public CUIComponentBase { Q_OBJECT public: explicit CUILineEdit(CUIConfig* config, QVector &subCUI, QWidget *parent = nullptr); qint32 getLabelWidth(); void setLabelWidth(qint32 width); private: void iniUI(QVector &subCUI); // 设置格式校验器 void setValidator(); // 设置输入提示 void setInputTips(); void showRangeError(); QLabel* m_label; QLineEdit* m_lineEdit; QHBoxLayout* m_layout; // QString lastEdited; signals: private slots: void onTextChanged(const QString &text); }; #endif // CUILINEEDIT_H