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

36 lines
976 B
C++

#include "CUIContainerTabWidget.h"
#include <CUIConfig.h>
#include <CUIPropertyWidget.h>
#include <QVBoxLayout>
/**
* @brief CUIContainerTabWidget::CUIContainerTabWidget 构造函数
* @param conf 配置信息
* @param parent
*/
CUIContainerTabWidget::CUIContainerTabWidget(
CUIConfig* conf, QVector<CUIPropertyWidget*>& subCUI, QWidget* parent)
: CUIComponentBaseContainerWidget(parent)
{
this->conf = conf;
initUI(subCUI);
}
/**
* @brief CUIContainerTabWidget::initUI 根据配置信息初始化
*/
void CUIContainerTabWidget::initUI(QVector<CUIPropertyWidget*>& subCUI)
{
m_tabWidget = new QTabWidget;
for (auto conf : conf->getSub()) {
CUIPropertyWidget* subui = new CUIPropertyWidget(nullptr, conf);
subCUI.push_back(subui);
m_tabWidget->addTab(subui->getUI(), conf->getPropertyValue("name"));
}
QVBoxLayout* layout = new QVBoxLayout;
layout->addWidget(m_tabWidget);
this->setLayout(layout);
}