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.
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
3 weeks ago
|
#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) : QGroupBox(parent)
|
||
|
{
|
||
|
this->conf = conf;
|
||
|
iniUI(subCUI);
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @brief CUIGroupBox::iniUI 根据配置信息进行初始化
|
||
|
*/
|
||
|
void CUIGroupBox::iniUI(QVector<CUI*> &subCUI)
|
||
|
{
|
||
|
this->setTitle(conf->property["name"]);
|
||
|
// appLayout();
|
||
|
layout = appLayout(conf);
|
||
|
this->setLayout(layout);
|
||
|
|
||
|
qDebug()<<this->conf->sub.size();
|
||
|
for(auto conf : this->conf->sub){
|
||
|
CUI* tmp = new CUI(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);
|
||
|
//}
|