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.
|
|
|
#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->getSub()) {
|
|
|
|
CUI* tmp = new CUI(nullptr, conf);
|
|
|
|
subCUI.push_back(tmp);
|
|
|
|
layout->addWidget(tmp->getUI());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief CUIWidget::getProperty 获取配置信息
|
|
|
|
* @param key
|
|
|
|
* @return val
|
|
|
|
*/
|
|
|
|
QString CUIWidget::getProperty(QString key)
|
|
|
|
{
|
|
|
|
return conf->getPropertyValue(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
|