#include "CUIContainerTabWidget.h" #include #include #include /** * @brief CUIContainerTabWidget::CUIContainerTabWidget 构造函数 * @param conf 配置信息 * @param parent */ CUIContainerTabWidget::CUIContainerTabWidget( CUIConfig* conf, QVector& subCUI, QWidget* parent) : CUIComponentBaseContainerWidget(parent) { this->conf = conf; initUI(subCUI); } /** * @brief CUIContainerTabWidget::initUI 根据配置信息初始化 */ void CUIContainerTabWidget::initUI(QVector& 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); }