#include "CUIWidget.h" #include "CUIConfig.h" #include "QVBoxLayout" #include #include #include #include /** * @brief CUIWidget::CUIWidget 构造函数 * @param conf 配置信息 * @param parent */ CUIWidget::CUIWidget(CUIConfig *conf, QVector &subCUI, QWidget *parent): QWidget(parent) { this->conf = conf; iniUI(subCUI); } /** * @brief CUIWidget::iniUI 根据配置信息初始化 */ void CUIWidget::iniUI(QVector &subCUI) { layout = appLayout(conf); this->setLayout(layout); // qDebug()<<"widget add layout"; for(auto &conf : this->conf->getSub()) { CUI* tmp = new CUI(nullptr, conf); subCUI.push_back(tmp); layout->addWidget(tmp->getUI()); } } /** * @brief CUIWidget::getProperty 获取配置信息 * @param key * @return val */ QString CUIWidget::getProperty(QString key) { return conf->getPropertyValue(key); }