You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
960 B
C++
40 lines
960 B
C++
#include "CUIGroupBox.h"
|
|
|
|
#include<CUIConfig.h>
|
|
#include<QVBoxLayout>
|
|
#include<QFormLayout>
|
|
#include<CUI.h>
|
|
#include<QDebug>
|
|
|
|
/**
|
|
* @brief CUIGroupBox::CUIGroupBox 构造函数
|
|
* @param conf
|
|
* @param parent
|
|
*/
|
|
CUIGroupBox::CUIGroupBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent)
|
|
{
|
|
this->conf = conf;
|
|
iniUI(subCUI);
|
|
}
|
|
|
|
|
|
/**
|
|
* @brief CUIGroupBox::iniUI 根据配置信息进行初始化
|
|
*/
|
|
void CUIGroupBox::iniUI(QVector<CUI*> &subCUI)
|
|
{
|
|
m_groupBox = new QGroupBox;
|
|
m_groupBox->setTitle(conf->getPropertyValue("name"));
|
|
m_layout = this->getLayout(conf);
|
|
m_groupBox->setLayout(m_layout);
|
|
for(auto conf : this->conf->getSub()) {
|
|
CUI* tmp = new CUI(nullptr, conf);
|
|
subCUI.push_back(tmp);
|
|
m_layout->addWidget(tmp->getUI());
|
|
}
|
|
|
|
QVBoxLayout* mainLayout = new QVBoxLayout;
|
|
mainLayout->addWidget(m_groupBox);
|
|
this->setLayout(mainLayout);
|
|
}
|