1、构建多选表格组件;

feature/struct-menu-20241023
simonyan 2 weeks ago
parent 7a3e216e0f
commit 696f581460

@ -10,6 +10,7 @@
#include "CFDStructDataSolverInitializationManager.h" #include "CFDStructDataSolverInitializationManager.h"
#include "CFDStructDataSolverReferenceQuantityManager.h" #include "CFDStructDataSolverReferenceQuantityManager.h"
#include "CFDStructDataSolverComputingControlManager.h" #include "CFDStructDataSolverComputingControlManager.h"
#include "CFDStructDataSolverMonitorResidualManager.h"
#include "CUIProperty/CUIConfig.h" #include "CUIProperty/CUIConfig.h"
@ -57,7 +58,8 @@ CUIConfig *CFDStructDataManager::getActionParamUIConfig(QString s)
// 计算控制 // 计算控制
if (s == "actionComputationalControlEdit") if (s == "actionComputationalControlEdit")
return m_solverComputingControlManager->getParamUIConfig(); return m_solverComputingControlManager->getParamUIConfig();
if (s == "actionComputationalMonitorsResidual")
return m_solverMonitorResidualManager->getParamUIConfig();
qDebug() << "DataManager return null CUIConfig"; qDebug() << "DataManager return null CUIConfig";
return nullptr; return nullptr;
} }
@ -74,4 +76,6 @@ void CFDStructDataManager::initDataManagers()
m_solverInitializationManager = new CFDStructDataSolverInitializationManager; m_solverInitializationManager = new CFDStructDataSolverInitializationManager;
m_solverReferenceQuantityManager = new CFDStructDataSolverReferenceQuantityManager; m_solverReferenceQuantityManager = new CFDStructDataSolverReferenceQuantityManager;
m_solverComputingControlManager = new CFDStructDataSolverComputingControlManager; m_solverComputingControlManager = new CFDStructDataSolverComputingControlManager;
m_solverMonitorResidualManager = new CFDStructDataSolverMonitorResidualManager;
} }

@ -13,6 +13,7 @@ class CFDStructDataSolverTimeModeManager;
class CFDStructDataSolverBasicModelManager; class CFDStructDataSolverBasicModelManager;
class CFDStructDataSolverKvislManager; class CFDStructDataSolverKvislManager;
class CFDStructDataSolverNumericalMethodManager; class CFDStructDataSolverNumericalMethodManager;
class CFDStructDataSolverMonitorResidualManager;
class CUIConfig; class CUIConfig;
class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataManager class CFDSTRUCTDATAMANAGER_EXPORT CFDStructDataManager
@ -45,6 +46,8 @@ private:
CFDStructDataSolverReferenceQuantityManager *m_solverReferenceQuantityManager; CFDStructDataSolverReferenceQuantityManager *m_solverReferenceQuantityManager;
// 计算控制 // 计算控制
CFDStructDataSolverComputingControlManager *m_solverComputingControlManager; CFDStructDataSolverComputingControlManager *m_solverComputingControlManager;
// 监控-残差曲线
CFDStructDataSolverMonitorResidualManager *m_solverMonitorResidualManager;
}; };
#endif // CFDSTRUCTDATAMANAGER_H #endif // CFDSTRUCTDATAMANAGER_H

@ -3,6 +3,9 @@ SOURCES += \
$$PWD/CFDStructDataSolverBoundaryConditionManager.cpp \ $$PWD/CFDStructDataSolverBoundaryConditionManager.cpp \
$$PWD/CFDStructDataSolverComputingControlManager.cpp \ $$PWD/CFDStructDataSolverComputingControlManager.cpp \
$$PWD/CFDStructDataSolverInitializationManager.cpp \ $$PWD/CFDStructDataSolverInitializationManager.cpp \
$$PWD/CFDStructDataSolverMonitorAerodynamicManager.cpp \
$$PWD/CFDStructDataSolverMonitorImpellerManager.cpp \
$$PWD/CFDStructDataSolverMonitorResidualManager.cpp \
$$PWD/CFDStructDataSolverReferenceQuantityManager.cpp \ $$PWD/CFDStructDataSolverReferenceQuantityManager.cpp \
$$PWD/CFDStructDataSolverSportsAttributesManager.cpp \ $$PWD/CFDStructDataSolverSportsAttributesManager.cpp \
$$PWD/CFDStructDataSolverTimeModeManager.cpp \ $$PWD/CFDStructDataSolverTimeModeManager.cpp \
@ -17,6 +20,9 @@ HEADERS += \
$$PWD/CFDStructDataSolverBoundaryConditionManager.h \ $$PWD/CFDStructDataSolverBoundaryConditionManager.h \
$$PWD/CFDStructDataSolverComputingControlManager.h \ $$PWD/CFDStructDataSolverComputingControlManager.h \
$$PWD/CFDStructDataSolverInitializationManager.h \ $$PWD/CFDStructDataSolverInitializationManager.h \
$$PWD/CFDStructDataSolverMonitorAerodynamicManager.h \
$$PWD/CFDStructDataSolverMonitorImpellerManager.h \
$$PWD/CFDStructDataSolverMonitorResidualManager.h \
$$PWD/CFDStructDataSolverReferenceQuantityManager.h \ $$PWD/CFDStructDataSolverReferenceQuantityManager.h \
$$PWD/CFDStructDataSolverSportsAttributesManager.h \ $$PWD/CFDStructDataSolverSportsAttributesManager.h \
$$PWD/CFDStructDataSolverTimeModeManager.h \ $$PWD/CFDStructDataSolverTimeModeManager.h \

@ -0,0 +1,11 @@
#include "CFDStructDataSolverMonitorAerodynamicManager.h"
CFDStructDataSolverMonitorAerodynamicManager::CFDStructDataSolverMonitorAerodynamicManager(QObject *parent) : CFDStructDataSolverBasicModelManager(parent)
{
}
CUIConfig *CFDStructDataSolverMonitorAerodynamicManager::getParamUIConfig()
{
return NULL;
}

@ -0,0 +1,13 @@
#ifndef CFDSTRUCTDATASOLVERMONITORAERODYNAMICMANAGER_H
#define CFDSTRUCTDATASOLVERMONITORAERODYNAMICMANAGER_H
#include "CFDStructDataSolverBasicModelManager.h"
class CFDStructDataSolverMonitorAerodynamicManager : public CFDStructDataSolverBasicModelManager
{
public:
explicit CFDStructDataSolverMonitorAerodynamicManager(QObject *parent = nullptr);
CUIConfig* getParamUIConfig();
};
#endif // CFDSTRUCTDATASOLVERMONITORAERODYNAMICMANAGER_H

@ -0,0 +1,11 @@
#include "CFDStructDataSolverMonitorImpellerManager.h"
CFDStructDataSolverMonitorImpellerManager::CFDStructDataSolverMonitorImpellerManager(QObject *parent) : CFDStructDataSolverBasicModelManager(parent)
{
}
CUIConfig *CFDStructDataSolverMonitorImpellerManager::getParamUIConfig()
{
return NULL;
}

@ -0,0 +1,14 @@
#ifndef CFDSTRUCTDATASOLVERMONITORIMPELLERMANAGER_H
#define CFDSTRUCTDATASOLVERMONITORIMPELLERMANAGER_H
#include "CFDStructDataSolverBasicModelManager.h"
class CFDStructDataSolverMonitorImpellerManager : public CFDStructDataSolverBasicModelManager
{
public:
explicit CFDStructDataSolverMonitorImpellerManager(QObject *parent = nullptr);
CUIConfig* getParamUIConfig();
};
#endif // CFDSTRUCTDATASOLVERMONITORIMPELLERMANAGER_H

@ -0,0 +1,12 @@
#include "CFDStructDataSolverMonitorResidualManager.h"
CFDStructDataSolverMonitorResidualManager::CFDStructDataSolverMonitorResidualManager(QObject *parent) : CFDStructDataSolverBasicModelManager(parent)
{
}
CUIConfig *CFDStructDataSolverMonitorResidualManager::getParamUIConfig()
{
return new CUIConfig({
{"type", "MultiTableWidget"}}, {});
}

@ -0,0 +1,14 @@
#ifndef CFDSTRUCTDATASOLVERMONITORRESIDUALMANAGER_H
#define CFDSTRUCTDATASOLVERMONITORRESIDUALMANAGER_H
#include "CFDStructDataSolverBasicModelManager.h"
class CFDStructDataSolverMonitorResidualManager : public CFDStructDataSolverBasicModelManager
{
public:
explicit CFDStructDataSolverMonitorResidualManager(QObject *parent = nullptr);
CUIConfig* getParamUIConfig();
};
#endif // CFDSTRUCTDATASOLVERMONITORRESIDUALMANAGER_H

@ -275,7 +275,9 @@ namespace GUI
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControl: case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverComputationalControl:
name = "actionComputationalControlEdit"; name = "actionComputationalControlEdit";
break; break;
case SolutionAnalysisTreeEnum::SATree_ComputationalSetupComputationalDomainSolverMonitorsResidual:
name = "actionComputationalMonitorsResidual";
break;
default: default:
name = ""; name = "";
} }

@ -13,6 +13,7 @@
#include<QDebug> #include<QDebug>
#include<CUIButtonBox.h> #include<CUIButtonBox.h>
#include<QVBoxLayout> #include<QVBoxLayout>
#include<CUIMultiTableWidget.h>
/** /**
@ -57,6 +58,8 @@ void CUI::buildUI()
widget = new CUIButtonBox(conf, subCUI); widget = new CUIButtonBox(conf, subCUI);
} else if(type == "RadioComponent"){ } else if(type == "RadioComponent"){
widget = new CUIRadioComponent(conf,subCUI); widget = new CUIRadioComponent(conf,subCUI);
} else if(type == "MultiTableWidget") {
widget = new CUIMultiTableWidget(conf, subCUI);
} }
if (widget) { if (widget) {
QVBoxLayout *layout = new QVBoxLayout; QVBoxLayout *layout = new QVBoxLayout;

@ -17,14 +17,14 @@
CUIButtonBox::CUIButtonBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent) CUIButtonBox::CUIButtonBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
/** /**
* @brief CUIButtonBox::iniUI * @brief CUIButtonBox::initUI
* @param subCUI * @param subCUI
*/ */
void CUIButtonBox::iniUI(QVector<CUI *> &subCUI) void CUIButtonBox::initUI(QVector<CUI *> &subCUI)
{ {
m_groupBox = new QGroupBox; m_groupBox = new QGroupBox;

@ -15,7 +15,7 @@ public:
explicit CUIButtonBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr); explicit CUIButtonBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
private: private:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
CUIConfig* conf; CUIConfig* conf;
QLayout* layout; QLayout* layout;
QGroupBox* m_groupBox; QGroupBox* m_groupBox;

@ -6,10 +6,10 @@
CUICheckBox::CUICheckBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QCheckBox(parent) CUICheckBox::CUICheckBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QCheckBox(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
void CUICheckBox::iniUI(QVector<CUI*> &subCUI) void CUICheckBox::initUI(QVector<CUI*> &subCUI)
{ {
this->setText(conf->getPropertyValue("name")); this->setText(conf->getPropertyValue("name"));

@ -14,7 +14,7 @@ public:
explicit CUICheckBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr); explicit CUICheckBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
private: private:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
CUIConfig* conf; CUIConfig* conf;

@ -15,7 +15,7 @@
CUIComboBox::CUIComboBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QWidget(parent) CUIComboBox::CUIComboBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QWidget(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
/** /**
@ -39,9 +39,9 @@ void CUIComboBox::setLabelWidth(qint32 width)
/** /**
* @brief CUIComboBox::iniUI widget,labelcomboBox * @brief CUIComboBox::initUI widget,labelcomboBox
*/ */
void CUIComboBox::iniUI(QVector<CUI*> &subCUI) void CUIComboBox::initUI(QVector<CUI*> &subCUI)
{ {
label = new QLabel(conf->getPropertyValue("name")); label = new QLabel(conf->getPropertyValue("name"));
comboBox = new QComboBox; comboBox = new QComboBox;

@ -17,7 +17,7 @@ public:
qint32 getLabelWidth(); qint32 getLabelWidth();
void setLabelWidth(qint32 width); void setLabelWidth(qint32 width);
private: private:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
void iniComoboBox(); void iniComoboBox();
QComboBox* comboBox; QComboBox* comboBox;
QLabel* label; QLabel* label;

@ -26,3 +26,8 @@ QLayout *CUIComponentBaseContainerWidget::getLayout(CUIConfig *conf)
layout->setMargin(0); layout->setMargin(0);
return layout; return layout;
} }
void CUIComponentBaseContainerWidget::initUI()
{
}

@ -12,6 +12,7 @@ public:
explicit CUIComponentBaseContainerWidget(QWidget *parent = nullptr); explicit CUIComponentBaseContainerWidget(QWidget *parent = nullptr);
protected: protected:
virtual QLayout* getLayout(CUIConfig* conf); virtual QLayout* getLayout(CUIConfig* conf);
virtual void initUI();
protected: protected:
QLayout* m_layout; QLayout* m_layout;
signals: signals:

@ -26,3 +26,8 @@ QLayout *CUIComponentBaseWidget::getLayout(CUIConfig *conf)
layout->setMargin(0); layout->setMargin(0);
return layout; return layout;
} }
void CUIComponentBaseWidget::initUI()
{
}

@ -11,9 +11,9 @@ public:
explicit CUIComponentBaseWidget(QWidget *parent = nullptr); explicit CUIComponentBaseWidget(QWidget *parent = nullptr);
protected: protected:
virtual QLayout* getLayout(CUIConfig* conf); virtual QLayout* getLayout(CUIConfig* conf);
virtual void initUI();
protected: protected:
QLayout* m_layout = nullptr;
signals: signals:
}; };

@ -14,14 +14,14 @@
CUIGroupBox::CUIGroupBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent) CUIGroupBox::CUIGroupBox(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseContainerWidget(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
/** /**
* @brief CUIGroupBox::iniUI * @brief CUIGroupBox::initUI
*/ */
void CUIGroupBox::iniUI(QVector<CUI*> &subCUI) void CUIGroupBox::initUI(QVector<CUI*> &subCUI)
{ {
m_groupBox = new QGroupBox; m_groupBox = new QGroupBox;
m_groupBox->setTitle(conf->getPropertyValue("name")); m_groupBox->setTitle(conf->getPropertyValue("name"));

@ -19,7 +19,7 @@ protected:
QLayout* m_layout; QLayout* m_layout;
QGroupBox* m_groupBox; QGroupBox* m_groupBox;
protected: protected:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
signals: signals:

@ -16,7 +16,7 @@
CUILineEdit::CUILineEdit(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseWidget(parent) CUILineEdit::CUILineEdit(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseWidget(parent)
{ {
this->m_conf = conf; this->m_conf = conf;
this->iniUI(subCUI); this->initUI(subCUI);
} }
@ -40,9 +40,9 @@ void CUILineEdit::setLabelWidth(qint32 width)
/** /**
* @brief CUILineEdit::iniUI * @brief CUILineEdit::initUI
*/ */
void CUILineEdit::iniUI(QVector<CUI*> &subCUI) void CUILineEdit::initUI(QVector<CUI*> &subCUI)
{ {
m_layout = new QHBoxLayout(); m_layout = new QHBoxLayout();
m_label = new QLabel(m_conf->getPropertyValue("name")); m_label = new QLabel(m_conf->getPropertyValue("name"));

@ -20,7 +20,7 @@ public:
qint32 getLabelWidth(); qint32 getLabelWidth();
void setLabelWidth(qint32 width); void setLabelWidth(qint32 width);
private: private:
void iniUI(QVector<CUI*> &subCUI); virtual void initUI(QVector<CUI*> &subCUI);
// 设置格式校验器 // 设置格式校验器
void setValidator(); void setValidator();
// 设置输入提示 // 设置输入提示

@ -0,0 +1,67 @@
#include "CUIMultiTableWidget.h"
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QHeaderView>
#include <QList>
#include <QPair>
#include <QVBoxLayout>
#include <QCheckBox>
#include "CUI.h"
CUIMultiTableWidget::CUIMultiTableWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : CUIComponentBaseWidget(parent)
{
this->initUI();
}
void CUIMultiTableWidget::initUI()
{
QStringList headers;
headers<<tr("index")<<tr("name")<<tr("view");
QList<QList<QString>> items;
QList<QString> item1 = {tr("quaility"), "quaility"};
QList<QString> item2 = {tr("x"), "x"};
QList<QString> item3 = {tr("y"), "y"};
QList<QString> item4 = {tr("z"), "z"};
items.append(item1);
items.append(item2);
items.append(item3);
items.append(item4);
// 根据配置来初始化tableWidget
m_tableWidget = new QTableWidget(this);
m_tableWidget->setColumnCount(items.count() + 2);
m_tableWidget->setRowCount(items.count());
m_tableWidget->setHorizontalHeaderLabels(headers);
// 设置水平表头的背景颜色
m_tableWidget->setStyleSheet(QString(u8"QHeaderView::section{background-color: rgb(226,234,243); color: black; border:1px solid rgb(255, 255, 255);}"));
m_tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); // 禁止编辑
m_tableWidget->setFocusPolicy(Qt::NoFocus);
// 隐藏垂直表头
QHeaderView *verticalHeader = m_tableWidget->verticalHeader();
verticalHeader->setVisible(false);
for (int i=0;i<items.count();i++) {
QList<QString> item = items[i];
// 序号
QTableWidgetItem* indexItem = new QTableWidgetItem(QString("%1").arg(i+1));
indexItem->setFlags(indexItem->flags() &~Qt::ItemIsSelectable);
indexItem->setTextAlignment(Qt::AlignCenter); // 设置水平居中
m_tableWidget->setItem(i,0, indexItem);
// 内容
for (int j=0;j<item.count();j++) {
QTableWidgetItem* nameItem = new QTableWidgetItem(item[j]);
nameItem->setFlags(indexItem->flags() &~Qt::ItemIsSelectable);
nameItem->setTextAlignment(Qt::AlignCenter); // 设置水平居中
m_tableWidget->setItem(i,j+1, nameItem);
}
// 复选框
QTableWidgetItem *checkBoxItem = new QTableWidgetItem();
m_tableWidget->setItem(i,item.count() + 1, checkBoxItem);
QCheckBox* checkBox = new QCheckBox();
checkBox->setStyleSheet("margin-left:45%; margin-right:45%;");// 设置水平居中
m_tableWidget->setCellWidget(i, item.count() + 1, checkBox);
}
m_layout = new QVBoxLayout;
m_layout->addWidget(m_tableWidget);
this->setLayout(m_layout);
}

@ -0,0 +1,24 @@
#ifndef CUIMULTITABLEWIDGET_H
#define CUIMULTITABLEWIDGET_H
#include "CUIComponentBaseWidget.h"
#include "CUIComponentBase.h"
class QTableWidget;
class CUI;
class CUIMultiTableWidget : public CUIComponentBaseWidget, public CUIComponentBase
{
Q_OBJECT
public:
explicit CUIMultiTableWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
protected:
void initUI();
protected:
QTableWidget* m_tableWidget;
signals:
};
#endif // CUIMULTITABLEWIDGET_H

@ -4,34 +4,36 @@ HEADERS += \
$$PWD/CUIComponentBaseWidget.h \ $$PWD/CUIComponentBaseWidget.h \
$$PWD/CUIDefine.h \ $$PWD/CUIDefine.h \
$$PWD/CUIRadioComponent.h \ $$PWD/CUIRadioComponent.h \
CUI.h \ $$PWD/CUIMultiTableWidget.h \
CUIButtonBox.h \ $$PWD/CUI.h \
CUICheckBox.h \ $$PWD/CUIButtonBox.h \
CUIComboBox.h \ $$PWD/CUICheckBox.h \
CUIGroupBox.h \ $$PWD/CUIComboBox.h \
CUILineEdit.h \ $$PWD/CUIGroupBox.h \
CUIPushButton.h \ $$PWD/CUILineEdit.h \
CUIRadioButton.h \ $$PWD/CUIPushButton.h \
CUITabWidget.h \ $$PWD/CUIRadioButton.h \
CUIWidget.h \ $$PWD/CUITabWidget.h \
CUISigsCenter.h \ $$PWD/CUIWidget.h \
CUIPropertyAPI.h \ $$PWD/CUISigsCenter.h \
CUIConfig.h $$PWD/CUIPropertyAPI.h \
$$PWD/CUIConfig.h
SOURCES += \ SOURCES += \
$$PWD/CUIComponentBase.cpp \ $$PWD/CUIComponentBase.cpp \
$$PWD/CUIComponentBaseContainerWidget.cpp \ $$PWD/CUIComponentBaseContainerWidget.cpp \
$$PWD/CUIComponentBaseWidget.cpp \ $$PWD/CUIComponentBaseWidget.cpp \
$$PWD/CUIRadioComponent.cpp \ $$PWD/CUIRadioComponent.cpp \
CUI.cpp \ $$PWD/CUIMultiTableWidget.cpp \
CUIButtonBox.cpp \ $$PWD/CUI.cpp \
CUICheckBox.cpp \ $$PWD/CUIButtonBox.cpp \
CUIComboBox.cpp \ $$PWD/CUICheckBox.cpp \
CUIGroupBox.cpp \ $$PWD/CUIComboBox.cpp \
CUILineEdit.cpp \ $$PWD/CUIGroupBox.cpp \
CUIPushButton.cpp \ $$PWD/CUILineEdit.cpp \
CUIRadioButton.cpp \ $$PWD/CUIPushButton.cpp \
CUITabWidget.cpp \ $$PWD/CUIRadioButton.cpp \
CUIWidget.cpp \ $$PWD/CUITabWidget.cpp \
CUIConfig.cpp \ $$PWD/CUIWidget.cpp \
CUISigsCenter.cpp $$PWD/CUIConfig.cpp \
$$PWD/CUISigsCenter.cpp

@ -6,10 +6,10 @@
CUIPushButton::CUIPushButton(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QPushButton(parent) CUIPushButton::CUIPushButton(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QPushButton(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
void CUIPushButton::iniUI(QVector<CUI*> &subCUI) void CUIPushButton::initUI(QVector<CUI*> &subCUI)
{ {
this->setText(conf->getPropertyValue("name")); this->setText(conf->getPropertyValue("name"));
} }

@ -14,7 +14,7 @@ public:
explicit CUIPushButton(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr); explicit CUIPushButton(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
private: private:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
CUIConfig* conf; CUIConfig* conf;
signals: signals:

@ -7,10 +7,10 @@
CUIRadioButton::CUIRadioButton(CUIConfig* conf, QVector<CUI*> subCUI,QWidget *parent) : QRadioButton(parent) CUIRadioButton::CUIRadioButton(CUIConfig* conf, QVector<CUI*> subCUI,QWidget *parent) : QRadioButton(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(); initUI();
} }
void CUIRadioButton::iniUI() void CUIRadioButton::initUI()
{ {
this->setText(conf->getPropertyValue("name")); this->setText(conf->getPropertyValue("name"));

@ -15,7 +15,7 @@ public:
explicit CUIRadioButton(CUIConfig* conf, QVector<CUI*> subCUI, QWidget *parent = nullptr); explicit CUIRadioButton(CUIConfig* conf, QVector<CUI*> subCUI, QWidget *parent = nullptr);
private: private:
void iniUI(); void initUI();
CUIConfig* conf; CUIConfig* conf;
signals: signals:

@ -12,13 +12,13 @@
CUITabWidget::CUITabWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QTabWidget(parent) CUITabWidget::CUITabWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent) : QTabWidget(parent)
{ {
this->conf = conf; this->conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
/** /**
* @brief CUITabWidget::iniUI * @brief CUITabWidget::initUI
*/ */
void CUITabWidget::iniUI(QVector<CUI*> &subCUI) void CUITabWidget::initUI(QVector<CUI*> &subCUI)
{ {
for(auto conf : conf->getSub()) { for(auto conf : conf->getSub()) {
CUI* subui = new CUI(nullptr, conf); CUI* subui = new CUI(nullptr, conf);

@ -13,7 +13,7 @@ public:
explicit CUITabWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr); explicit CUITabWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
private: private:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
CUIConfig* conf; CUIConfig* conf;
QVector<CUI> subUI; QVector<CUI> subUI;

@ -14,13 +14,13 @@
CUIWidget::CUIWidget(CUIConfig *conf, QVector<CUI*> &subCUI, QWidget *parent): CUIComponentBaseContainerWidget(parent) CUIWidget::CUIWidget(CUIConfig *conf, QVector<CUI*> &subCUI, QWidget *parent): CUIComponentBaseContainerWidget(parent)
{ {
this->m_conf = conf; this->m_conf = conf;
iniUI(subCUI); initUI(subCUI);
} }
/** /**
* @brief CUIWidget::iniUI * @brief CUIWidget::initUI
*/ */
void CUIWidget::iniUI(QVector<CUI*> &subCUI) void CUIWidget::initUI(QVector<CUI*> &subCUI)
{ {
m_layout = this->getLayout(m_conf); m_layout = this->getLayout(m_conf);
this->setLayout(m_layout); this->setLayout(m_layout);

@ -13,7 +13,7 @@ class CUIWidget : public CUIComponentBaseContainerWidget, CUIComponentBase
public: public:
explicit CUIWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr); explicit CUIWidget(CUIConfig* conf, QVector<CUI*> &subCUI, QWidget *parent = nullptr);
private: private:
void iniUI(QVector<CUI*> &subCUI); void initUI(QVector<CUI*> &subCUI);
signals: signals:
}; };

Loading…
Cancel
Save