#ifndef CUI_H #define CUI_H #include #include #include #include "CUIPropertyAPI.h" class CUIConfig; class QWidget; class CUIWidget; class CUIGroupBox; class CUILineEdit; class CUITabWidget; class QString; class CUIComboBox; class CUIPushButton; class CUICheckBox; class CUIRadioButton; class CUIButtonBox; /** * @brief The CUI class 管理类,通过处理config来创建相应的组件并提供服务 */ class CUIPropertyAPI CUI: public QWidget { Q_OBJECT public: CUI(QWidget* parent = nullptr, CUIConfig* conf = nullptr); // CUI(CUIConfig* conf); void buildUI(); void check(); QWidget* getUI(); QString getProperty(QString s); void autoArrangeWidgets(); private: CUIConfig* conf; CUILineEdit* uiLineEdit; CUIWidget* uiWidget; CUIGroupBox* uiGroupBox; CUITabWidget* uiTabWidget; CUIComboBox* uiComboBox; CUIPushButton* uiPushButton; CUICheckBox* uiCheckBox; CUIRadioButton* uiRadioButton; CUIButtonBox* uiButtonBox; QVector subCUI; const QSet haveLabelType = {"LineEdit", "ComboBox"}; qint32 getMaxLabelWidth(); void setLabelWidth(qint32 width); }; #endif // CUI_H