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.
AppFlow/CFDStruct/CUIProperty/CUIContainerGroupBox.cpp

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);
}