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.
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#include "CUIContainerGroupBox.h"
|
|
|
|
#include <CUIConfig.h>
|
|
#include <CUIPropertyWidget.h>
|
|
|
|
#include <QDebug>
|
|
#include <QFormLayout>
|
|
#include <QVBoxLayout>
|
|
|
|
/**
|
|
* @brief CUIContainerGroupBox::CUIContainerGroupBox 构造函数
|
|
* @param conf
|
|
* @param parent
|
|
*/
|
|
CUIContainerGroupBox::CUIContainerGroupBox(CUIConfig* conf,
|
|
QVector<CUIPropertyWidget*>& subCUI,
|
|
QWidget* parent)
|
|
: CUIComponentBaseContainerWidget(parent)
|
|
{
|
|
this->m_conf = conf;
|
|
initUI(subCUI);
|
|
}
|
|
|
|
/**
|
|
* @brief CUIContainerGroupBox::initUI 根据配置信息进行初始化
|
|
*/
|
|
void CUIContainerGroupBox::initUI(QVector<CUIPropertyWidget*>& subCUI)
|
|
{
|
|
m_groupBox = new QGroupBox;
|
|
m_groupBox->setTitle(m_conf->getPropertyValue("name"));
|
|
m_layout = this->getLayout(m_conf);
|
|
m_groupBox->setLayout(m_layout);
|
|
for (auto conf : this->m_conf->getSub()) {
|
|
CUIPropertyWidget* tmp = new CUIPropertyWidget(nullptr, conf);
|
|
subCUI.push_back(tmp);
|
|
m_layout->addWidget(tmp->getUI());
|
|
}
|
|
QVBoxLayout* mainLayout = new QVBoxLayout;
|
|
mainLayout->addWidget(m_groupBox);
|
|
this->setLayout(mainLayout);
|
|
}
|