#include "CUIGroupBox.h" #include #include #include #include #include /** * @brief CUIGroupBox::CUIGroupBox 构造函数 * @param conf * @param parent */ CUIGroupBox::CUIGroupBox(CUIConfig* conf, QVector &subCUI, QWidget *parent) : QGroupBox(parent) { this->conf = conf; iniUI(subCUI); } /** * @brief CUIGroupBox::iniUI 根据配置信息进行初始化 */ void CUIGroupBox::iniUI(QVector &subCUI) { this->setTitle(conf->getPropertyValue("name")); // appLayout(); layout = appLayout(conf); this->setLayout(layout); qDebug() << this->conf->getSub().size(); for(auto conf : this->conf->getSub()) { CUI* tmp = new CUI(nullptr, conf); subCUI.push_back(tmp); layout->addWidget(tmp->getUI()); } } /** * @brief CUIGroupBox::appLayout 根据配置信息应用layout */ //void CUIGroupBox::appLayout() //{ // if(conf->property["layout"] == "QVBoxLayout") // layout = new QVBoxLayout(); // layout = new QFormLayout(); // this->setLayout(layout); //}