#ifndef CUIPROPERTYWIDGET_H #define CUIPROPERTYWIDGET_H #include #include #include #include "CUIPropertyAPI.h" class CUIConfig; class QWidget; class CUIComponentBaseWidget; /** * @brief The CUI class 管理类,通过处理config来创建相应的组件并提供服务 */ class CUIPropertyAPI CUIPropertyWidget: public QWidget { Q_OBJECT public: CUIPropertyWidget(QWidget* parent = nullptr, CUIConfig* conf = nullptr); void buildUI(); void check(); QWidget* getUI(); QString getProperty(QString s); void autoArrangeWidgets(); private: CUIConfig* conf; // 根据配置生成的视图 CUIComponentBaseWidget* m_mainWidget = nullptr; // 子组件配置 QVector subCUI; // 具有label标签的类型,需要处理长度统一 const QSet haveLabelType = {"LineEdit", "ComboBox"}; qint32 getMaxLabelWidth(); void setLabelWidth(qint32 width); }; #endif // CUIPROPERTYWIDGET_H