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/CUIButtonBox.cpp

49 lines
1.2 KiB
C++

3 weeks ago
#include "CUIButtonBox.h"
#include<CUIConfig.h>
#include<CUI.h>
#include<QButtonGroup>
#include<QLayout>
#include<QAbstractButton>
#include<QDebug>
#include<QRadioButton>
/**
* @brief CUIButtonBox::CUIButtonBox
* @param conf
* @param subCUI
* @param parent
*/
CUIButtonBox::CUIButtonBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent)
3 weeks ago
{
this->conf = conf;
iniUI(subCUI);
3 weeks ago
}
/**
* @brief CUIButtonBox::iniUI
* @param subCUI
*/
void CUIButtonBox::iniUI(QVector<CUI *> &subCUI)
{
3 weeks ago
m_groupBox = new QGroupBox;
m_groupBox->setTitle(conf->getPropertyValue("name"));
m_layout = this->getLayout(conf);
m_groupBox->setLayout(m_layout);
qDebug() << this->conf->getSub().size();
for(auto conf : this->conf->getSub()) {
// CUI* tmp = new CUI(nullptr, conf);
// subCUI.push_back(tmp);
// m_layout->addWidget(tmp->getUI());
QRadioButton* radio = new QRadioButton(conf->getPropertyValue("name"));
m_layout->addWidget(radio);
}
QVBoxLayout* mainLayout = new QVBoxLayout;
mainLayout->addWidget(m_groupBox);
this->setLayout(mainLayout);
3 weeks ago
}
3 weeks ago