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

49 lines
917 B
C++

3 weeks ago
#include "CUIWidget.h"
#include "CUIConfig.h"
#include "QVBoxLayout"
#include <QLayout>
#include <CUICommon.h>
#include <CUI.h>
#include<QDebug>
/**
* @brief CUIWidget::CUIWidget
* @param conf
* @param parent
*/
CUIWidget::CUIWidget(CUIConfig *conf,QVector<CUI*> &subCUI, QWidget *parent):QWidget(parent)
{
this->conf = conf;
iniUI(subCUI);
}
/**
* @brief CUIWidget::iniUI
*/
void CUIWidget::iniUI(QVector<CUI*> &subCUI)
{
layout = appLayout(conf);
this->setLayout(layout);
// qDebug()<<"widget add layout";
for(auto &conf : this->conf->sub){
CUI* tmp = new CUI(conf);
subCUI.push_back(tmp);
layout->addWidget(tmp->getUI());
}
}
/**
* @brief CUIWidget::getProperty
* @param key
* @return val
*/
QString CUIWidget::getProperty(QString key)
{
return conf->property[key];
}