From d76eea89368ef8d268a20418799f33039010334e Mon Sep 17 00:00:00 2001 From: mzh Date: Mon, 28 Oct 2024 12:01:05 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A0=91=E5=8D=95=E7=8B=AC=E7=AE=A1=E7=90=86=E7=B1=BBCFDTreeWi?= =?UTF-8?q?dget=202=E3=80=81=E6=B7=BB=E5=8A=A0=E7=BB=93=E6=9E=84=E6=A0=91I?= =?UTF-8?q?tem=E7=82=B9=E5=87=BB=E5=A4=84=E7=90=86=E6=A7=BD=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CFDStruct/CFDStructGUI/CFDMainTreeWidget.cpp | 163 +------------ CFDStruct/CFDStructGUI/CFDMainTreeWidget.h | 13 +- CFDStruct/CFDStructGUI/CFDStructGUI.pri | 3 +- .../CFDStructGUI/CFDStructMainWindow.cpp | 4 +- CFDStruct/CFDStructGUI/CFDStructMainWindow.h | 2 +- CFDStruct/CFDStructGUI/CFDTreeWidget.cpp | 214 ++++++++++++++++++ CFDStruct/CFDStructGUI/CFDTreeWidget.h | 45 ++++ GUIWidget/TreeWidget.cpp | 6 +- 8 files changed, 289 insertions(+), 161 deletions(-) create mode 100644 CFDStruct/CFDStructGUI/CFDTreeWidget.cpp create mode 100644 CFDStruct/CFDStructGUI/CFDTreeWidget.h diff --git a/CFDStruct/CFDStructGUI/CFDMainTreeWidget.cpp b/CFDStruct/CFDStructGUI/CFDMainTreeWidget.cpp index 56d3318..6d513fd 100644 --- a/CFDStruct/CFDStructGUI/CFDMainTreeWidget.cpp +++ b/CFDStruct/CFDStructGUI/CFDMainTreeWidget.cpp @@ -1,11 +1,14 @@ #include "CFDMainTreeWidget.h" #include "GUIWidget/TreeWidget.h" +#include "GUIFrame/PropertyWidget.h" +#include "CFDTreeWidget.h" namespace GUI{ - CFDMainTreeWidget::CFDMainTreeWidget(MainWindow *parent) : MainTreeWidget(parent) + CFDMainTreeWidget::CFDMainTreeWidget(MainWindow *parent, PropertyWidget* prowidget) : MainTreeWidget(parent) { + this->m_PropertyWidget = prowidget; // this->setWidget(_treeWidget); init(); @@ -25,174 +28,28 @@ namespace GUI{ void CFDMainTreeWidget::addTreePreprocessing(QTabWidget *tabWidget) { + _treePreprocessing = new TreeWidget(this); tabWidget->addTab(_treePreprocessing,tr("Preprocessing")); + _treePreprocessing->updateTree(); } void CFDMainTreeWidget::addTreeSolutionAnalysis(QTabWidget *tabWidget) { - _treeSolutionAnalysis = new TreeWidget(this); + _treeSolutionAnalysis = new CFDTreeWidget(this,m_PropertyWidget); tabWidget->addTab(_treeSolutionAnalysis,tr("SolutionAnalysis")); - - QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem(); - GeometryAndMeshingItem->setText(0,tr("Geometry and Meshing")); - GeometryAndMeshingItem->setData(1,0,-1); -// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::MainTreeEnum::MainTree_Mesh)); - _treeSolutionAnalysis->addTopLevelItem(GeometryAndMeshingItem); - - QTreeWidgetItem* mesh = new QTreeWidgetItem(); - mesh->setText(0,tr("Mesh001")); - mesh->setData(1,0,-1); - GeometryAndMeshingItem->addChild(mesh); - - - QTreeWidgetItem* ComputationalSetupItem = new QTreeWidgetItem(); - ComputationalSetupItem->setText(0,tr("Computational Setup")); - ComputationalSetupItem->setData(1,0,-1); - _treeSolutionAnalysis->addTopLevelItem(ComputationalSetupItem); - - QTreeWidgetItem* TimeModeItem = new QTreeWidgetItem(); - TimeModeItem->setText(0,tr("Time Mode")); - TimeModeItem->setData(1,0,-1); - ComputationalSetupItem->addChild(TimeModeItem); - - QTreeWidgetItem* ComputationalDomainItem = new QTreeWidgetItem(); - ComputationalDomainItem->setText(0,tr("Computational Domain")); - ComputationalDomainItem->setData(1,0,-1); - ComputationalSetupItem->addChild(ComputationalDomainItem); - - - QTreeWidgetItem* SolverItem = new QTreeWidgetItem(); - SolverItem->setText(0,tr("Solver")); - SolverItem->setData(1,0,-1); - ComputationalDomainItem->addChild(SolverItem); - - QTreeWidgetItem* BasicModelItem = new QTreeWidgetItem(); - BasicModelItem->setText(0,tr("Basic Model")); - BasicModelItem->setData(1,0,-1); - SolverItem->addChild(BasicModelItem); - QTreeWidgetItem* ViscosityModelItem = new QTreeWidgetItem(); - ViscosityModelItem->setText(0,tr("Viscosity Model")); - ViscosityModelItem->setData(1,0,-1); - SolverItem->addChild(ViscosityModelItem); - QTreeWidgetItem* NumericalMethodsItem = new QTreeWidgetItem(); - NumericalMethodsItem->setText(0,tr("Numerical Methods")); - NumericalMethodsItem->setData(1,0,-1); - SolverItem->addChild(NumericalMethodsItem); - - - QTreeWidgetItem* MotionPropertiesItem = new QTreeWidgetItem(); - MotionPropertiesItem->setText(0,tr("Motion Properties")); - MotionPropertiesItem->setData(1,0,-1); - ComputationalDomainItem->addChild(MotionPropertiesItem); - - QTreeWidgetItem* motion1Item = new QTreeWidgetItem(); - motion1Item->setText(0,tr("motion-1")); - motion1Item->setData(1,0,-1); - MotionPropertiesItem->addChild(motion1Item); - - QTreeWidgetItem* BoundaryConditionsItem = new QTreeWidgetItem(); - BoundaryConditionsItem->setText(0,tr("Boundary Conditions")); - BoundaryConditionsItem->setData(1,0,-1); - ComputationalDomainItem->addChild(BoundaryConditionsItem); - - QTreeWidgetItem* pressureinletItem = new QTreeWidgetItem(); - pressureinletItem->setText(0,tr("pressure-inlet")); - pressureinletItem->setData(1,0,-1); - BoundaryConditionsItem->addChild(pressureinletItem); - - - QTreeWidgetItem* InitializationItem = new QTreeWidgetItem(); - InitializationItem->setText(0,tr("Initialization")); - InitializationItem->setData(1,0,-1); - ComputationalDomainItem->addChild(InitializationItem); - - - QTreeWidgetItem* ComputationalControlItem = new QTreeWidgetItem(); - ComputationalControlItem->setText(0,tr("Computational Control")); - ComputationalControlItem->setData(1,0,-1); - ComputationalDomainItem->addChild(ComputationalControlItem); - - QTreeWidgetItem* ReferenceQuantityItem = new QTreeWidgetItem(); - ReferenceQuantityItem->setText(0,tr("reference quantity")); - ReferenceQuantityItem->setData(1,0,-1); - ComputationalControlItem->addChild(ReferenceQuantityItem); - - - - QTreeWidgetItem* MonitorsItem = new QTreeWidgetItem(); - MonitorsItem->setText(0,tr("Monitors")); - MonitorsItem->setData(1,0,-1); - ComputationalDomainItem->addChild(MonitorsItem); - - QTreeWidgetItem* ResidualItem = new QTreeWidgetItem(); - ResidualItem->setText(0,tr("Residual")); - ResidualItem->setData(1,0,-1); - MonitorsItem->addChild(ResidualItem); - QTreeWidgetItem* AerodynamicForceItem = new QTreeWidgetItem(); - AerodynamicForceItem->setText(0,tr("Aerodynamic Force")); - AerodynamicForceItem->setData(1,0,-1); - MonitorsItem->addChild(AerodynamicForceItem); - QTreeWidgetItem* TurbomachineryPerformanceItem = new QTreeWidgetItem(); - TurbomachineryPerformanceItem->setText(0,tr("Turbomachinery Performance")); - TurbomachineryPerformanceItem->setData(1,0,-1); - MonitorsItem->addChild(TurbomachineryPerformanceItem); - + _treeSolutionAnalysis->updateTree("SolutionAnalysis"); } void CFDMainTreeWidget::addTreePostprocessing(QTabWidget *tabWidget) { - _treePostprocessing = new TreeWidget(this); + _treePostprocessing = new CFDTreeWidget(this,m_PropertyWidget); tabWidget->addTab(_treePostprocessing,tr("Postprocessing")); - QTreeWidgetItem* PostProcessingItem = new QTreeWidgetItem(); - PostProcessingItem->setText(0,tr("Post-processing")); - PostProcessingItem->setData(1,0,-1); - _treePostprocessing->addTopLevelItem(PostProcessingItem); - - QTreeWidgetItem* MeshItem = new QTreeWidgetItem(); - MeshItem->setText(0,tr("Mesh")); - MeshItem->setData(1,0,-1); - PostProcessingItem->addChild(MeshItem); - - QTreeWidgetItem* Mesh1Item = new QTreeWidgetItem(); - Mesh1Item->setText(0,tr("Mesh 1")); - Mesh1Item->setData(1,0,-1); - MeshItem->addChild(Mesh1Item); - QTreeWidgetItem* Interface1Item = new QTreeWidgetItem(); - Interface1Item->setText(0,tr("Interface 1")); - Interface1Item->setData(1,0,-1); - MeshItem->addChild(Interface1Item); - - - QTreeWidgetItem* CuttingPlaneItem = new QTreeWidgetItem(); - CuttingPlaneItem->setText(0,tr("Cutting Plane")); - CuttingPlaneItem->setData(1,0,-1); - PostProcessingItem->addChild(CuttingPlaneItem); - - QTreeWidgetItem* IsosurfaceItem = new QTreeWidgetItem(); - IsosurfaceItem->setText(0,tr("Isosurface")); - IsosurfaceItem->setData(1,0,-1); - PostProcessingItem->addChild(IsosurfaceItem); - - QTreeWidgetItem* StreamlineItem = new QTreeWidgetItem(); - StreamlineItem->setText(0,tr("Streamline")); - StreamlineItem->setData(1,0,-1); - PostProcessingItem->addChild(StreamlineItem); - - QTreeWidgetItem* DataStatisticsItem = new QTreeWidgetItem(); - DataStatisticsItem->setText(0,tr("Data Statistics")); - DataStatisticsItem->setData(1,0,-1); - PostProcessingItem->addChild(DataStatisticsItem); - - QTreeWidgetItem* ForceAndMomentItem = new QTreeWidgetItem(); - ForceAndMomentItem->setText(0,tr("Force and Moment")); - ForceAndMomentItem->setData(1,0,-1); - DataStatisticsItem->addChild(ForceAndMomentItem); - + _treePostprocessing->updateTree("Postprocessing"); } diff --git a/CFDStruct/CFDStructGUI/CFDMainTreeWidget.h b/CFDStruct/CFDStructGUI/CFDMainTreeWidget.h index 620dbf4..d8dbc14 100644 --- a/CFDStruct/CFDStructGUI/CFDMainTreeWidget.h +++ b/CFDStruct/CFDStructGUI/CFDMainTreeWidget.h @@ -6,16 +6,20 @@ #include #include -class MainWindow; class QTabWidget; namespace GUI{ +class MainWindow; +class CFDTreeWidget; +class PropertyWidget; + + class CFDStructGUIAPI CFDMainTreeWidget : public MainTreeWidget{ Q_OBJECT public: - CFDMainTreeWidget(MainWindow* parent); + CFDMainTreeWidget(MainWindow* parent, PropertyWidget* prowidget); private: @@ -29,8 +33,9 @@ namespace GUI{ TreeWidget* _treePreprocessing; - TreeWidget* _treeSolutionAnalysis; - TreeWidget* _treePostprocessing; + CFDTreeWidget* _treeSolutionAnalysis; + CFDTreeWidget* _treePostprocessing; + PropertyWidget* m_PropertyWidget; }; diff --git a/CFDStruct/CFDStructGUI/CFDStructGUI.pri b/CFDStruct/CFDStructGUI/CFDStructGUI.pri index 1b2bfac..931f296 100644 --- a/CFDStruct/CFDStructGUI/CFDStructGUI.pri +++ b/CFDStruct/CFDStructGUI/CFDStructGUI.pri @@ -2,8 +2,9 @@ HEADERS += \ $$PWD/CFDStructGUIAPI.h \ $$PWD/CFDStructMainWindow.h \ $$PWD/CFDMainTreeWidget.h \ + $$PWD/CFDTreeWidget.h \ SOURCES += \ $$PWD/CFDStructMainWindow.cpp \ $$PWD/CFDMainTreeWidget.cpp \ - + $$PWD/CFDTreeWidget.cpp \ diff --git a/CFDStruct/CFDStructGUI/CFDStructMainWindow.cpp b/CFDStruct/CFDStructGUI/CFDStructMainWindow.cpp index 9e963a9..6444e6a 100644 --- a/CFDStruct/CFDStructGUI/CFDStructMainWindow.cpp +++ b/CFDStruct/CFDStructGUI/CFDStructMainWindow.cpp @@ -21,6 +21,7 @@ #include #include #include +#include //CFDStructMainWindow::CFDStructMainWindow() : GUI::MainWindow() //{ @@ -54,7 +55,7 @@ void CFDStructMainWindow::initCentralWidget() int mainWindSize = QMainWindow::width(); // _treeWidget = new MainTreeWidget(this); - _treeWidget = new CFDMainTreeWidget(this); + _treeWidget = new CFDMainTreeWidget(this,m_PropertyWidget); _treeWidget->setMinimumWidth(mainWindSize * 0.4); _treeWidget->setMaximumWidth(mainWindSize * 0.4); @@ -281,3 +282,4 @@ void CFDStructMainWindow::addSARibbonCategoryCivilAircraftTemplateLibrary() { SARibbonCategory* gategory = _ribbonBar->addCategoryPage(type); _ribbonBar->raiseCategory(gategory); } + diff --git a/CFDStruct/CFDStructGUI/CFDStructMainWindow.h b/CFDStruct/CFDStructGUI/CFDStructMainWindow.h index 4db96aa..03ac878 100644 --- a/CFDStruct/CFDStructGUI/CFDStructMainWindow.h +++ b/CFDStruct/CFDStructGUI/CFDStructMainWindow.h @@ -16,7 +16,7 @@ class CFDStructGUIAPI CFDStructMainWindow : public GUI::MainWindow { Q_OBJECT - +class QTreeWidgetItem; public: diff --git a/CFDStruct/CFDStructGUI/CFDTreeWidget.cpp b/CFDStruct/CFDStructGUI/CFDTreeWidget.cpp new file mode 100644 index 0000000..aee8cc2 --- /dev/null +++ b/CFDStruct/CFDStructGUI/CFDTreeWidget.cpp @@ -0,0 +1,214 @@ +#include "CFDTreeWidget.h" + +#include +#include +#include +#include + +namespace GUI{ + + CFDTreeWidget::CFDTreeWidget(QWidget* parent, PropertyWidget* m_PropertyWidget): + TreeWidget(parent) + { + this->m_PropertyWidget = m_PropertyWidget; + + //右键 不可少否则右键无反应 + setContextMenuPolicy(Qt::CustomContextMenu); + connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(onItemClicked(QTreeWidgetItem*, int))); + connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onModelCustomContextMenu(QPoint))); + + + } + + void CFDTreeWidget::updateTree(QString s){ + this->clear(); + + if(s == "SolutionAnalysis") + addTreeSolutionAnalysis(); + else if(s == "Postprocessing") + addTreePostprocessing(); + else if(s == "Preprocessing") + addTreePreprocessing(); + + setItemsExpandable(true); + expandAll(); + } + + void CFDTreeWidget::addTreePreprocessing(){ + QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem(); + GeometryAndMeshingItem->setText(0,tr("Preprocessing")); + GeometryAndMeshingItem->setData(1,0,-1); +// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::MainTreeEnum::MainTree_Mesh)); + this->addTopLevelItem(GeometryAndMeshingItem); + } + + void CFDTreeWidget::addTreeSolutionAnalysis() + { + QTreeWidgetItem* GeometryAndMeshingItem = new QTreeWidgetItem(); + GeometryAndMeshingItem->setText(0,tr("Geometry and Meshing")); + GeometryAndMeshingItem->setData(1,0,-1); +// GeometryAndMeshingItem->setData(2, 0, QVariant::fromValue(GUI::MainTreeEnum::MainTree_Mesh)); + this->addTopLevelItem(GeometryAndMeshingItem); + + QTreeWidgetItem* mesh = new QTreeWidgetItem(); + mesh->setText(0,tr("Mesh001")); + mesh->setData(1,0,-1); + GeometryAndMeshingItem->addChild(mesh); + + + QTreeWidgetItem* ComputationalSetupItem = new QTreeWidgetItem(); + ComputationalSetupItem->setText(0,tr("Computational Setup")); + ComputationalSetupItem->setData(1,0,-1); + this->addTopLevelItem(ComputationalSetupItem); + + QTreeWidgetItem* TimeModeItem = new QTreeWidgetItem(); + TimeModeItem->setText(0,tr("Time Mode")); + TimeModeItem->setData(1,0,-1); + ComputationalSetupItem->addChild(TimeModeItem); + + QTreeWidgetItem* ComputationalDomainItem = new QTreeWidgetItem(); + ComputationalDomainItem->setText(0,tr("Computational Domain")); + ComputationalDomainItem->setData(1,0,-1); + ComputationalSetupItem->addChild(ComputationalDomainItem); + + + QTreeWidgetItem* SolverItem = new QTreeWidgetItem(); + SolverItem->setText(0,tr("Solver")); + SolverItem->setData(1,0,-1); + ComputationalDomainItem->addChild(SolverItem); + + QTreeWidgetItem* BasicModelItem = new QTreeWidgetItem(); + BasicModelItem->setText(0,tr("Basic Model")); + BasicModelItem->setData(1,0,-1); + SolverItem->addChild(BasicModelItem); + QTreeWidgetItem* ViscosityModelItem = new QTreeWidgetItem(); + ViscosityModelItem->setText(0,tr("Viscosity Model")); + ViscosityModelItem->setData(1,0,-1); + SolverItem->addChild(ViscosityModelItem); + QTreeWidgetItem* NumericalMethodsItem = new QTreeWidgetItem(); + NumericalMethodsItem->setText(0,tr("Numerical Methods")); + NumericalMethodsItem->setData(1,0,-1); + SolverItem->addChild(NumericalMethodsItem); + + + QTreeWidgetItem* MotionPropertiesItem = new QTreeWidgetItem(); + MotionPropertiesItem->setText(0,tr("Motion Properties")); + MotionPropertiesItem->setData(1,0,-1); + ComputationalDomainItem->addChild(MotionPropertiesItem); + + QTreeWidgetItem* motion1Item = new QTreeWidgetItem(); + motion1Item->setText(0,tr("motion-1")); + motion1Item->setData(1,0,-1); + MotionPropertiesItem->addChild(motion1Item); + + QTreeWidgetItem* BoundaryConditionsItem = new QTreeWidgetItem(); + BoundaryConditionsItem->setText(0,tr("Boundary Conditions")); + BoundaryConditionsItem->setData(1,0,-1); + ComputationalDomainItem->addChild(BoundaryConditionsItem); + + QTreeWidgetItem* pressureinletItem = new QTreeWidgetItem(); + pressureinletItem->setText(0,tr("pressure-inlet")); + pressureinletItem->setData(1,0,-1); + BoundaryConditionsItem->addChild(pressureinletItem); + + + QTreeWidgetItem* InitializationItem = new QTreeWidgetItem(); + InitializationItem->setText(0,tr("Initialization")); + InitializationItem->setData(1,0,-1); + ComputationalDomainItem->addChild(InitializationItem); + + + QTreeWidgetItem* ComputationalControlItem = new QTreeWidgetItem(); + ComputationalControlItem->setText(0,tr("Computational Control")); + ComputationalControlItem->setData(1,0,-1); + ComputationalDomainItem->addChild(ComputationalControlItem); + + QTreeWidgetItem* ReferenceQuantityItem = new QTreeWidgetItem(); + ReferenceQuantityItem->setText(0,tr("reference quantity")); + ReferenceQuantityItem->setData(1,0,-1); + ComputationalControlItem->addChild(ReferenceQuantityItem); + + + + QTreeWidgetItem* MonitorsItem = new QTreeWidgetItem(); + MonitorsItem->setText(0,tr("Monitors")); + MonitorsItem->setData(1,0,-1); + ComputationalDomainItem->addChild(MonitorsItem); + + QTreeWidgetItem* ResidualItem = new QTreeWidgetItem(); + ResidualItem->setText(0,tr("Residual")); + ResidualItem->setData(1,0,-1); + MonitorsItem->addChild(ResidualItem); + QTreeWidgetItem* AerodynamicForceItem = new QTreeWidgetItem(); + AerodynamicForceItem->setText(0,tr("Aerodynamic Force")); + AerodynamicForceItem->setData(1,0,-1); + MonitorsItem->addChild(AerodynamicForceItem); + QTreeWidgetItem* TurbomachineryPerformanceItem = new QTreeWidgetItem(); + TurbomachineryPerformanceItem->setText(0,tr("Turbomachinery Performance")); + TurbomachineryPerformanceItem->setData(1,0,-1); + MonitorsItem->addChild(TurbomachineryPerformanceItem); + + } + + void CFDTreeWidget::addTreePostprocessing() + { +// _treePostprocessing = new TreeWidget(this); +// tabWidget->addTab(_treePostprocessing,tr("Postprocessing")); +// qDebug()<<"!!!"; + + + QTreeWidgetItem* PostProcessingItem = new QTreeWidgetItem(); + PostProcessingItem->setText(0,tr("Post-processing")); + PostProcessingItem->setData(1,0,-1); + this->addTopLevelItem(PostProcessingItem); + + QTreeWidgetItem* MeshItem = new QTreeWidgetItem(); + MeshItem->setText(0,tr("Mesh")); + MeshItem->setData(1,0,-1); + PostProcessingItem->addChild(MeshItem); + + QTreeWidgetItem* Mesh1Item = new QTreeWidgetItem(); + Mesh1Item->setText(0,tr("Mesh 1")); + Mesh1Item->setData(1,0,-1); + MeshItem->addChild(Mesh1Item); + QTreeWidgetItem* Interface1Item = new QTreeWidgetItem(); + Interface1Item->setText(0,tr("Interface 1")); + Interface1Item->setData(1,0,-1); + MeshItem->addChild(Interface1Item); + + + QTreeWidgetItem* CuttingPlaneItem = new QTreeWidgetItem(); + CuttingPlaneItem->setText(0,tr("Cutting Plane")); + CuttingPlaneItem->setData(1,0,-1); + PostProcessingItem->addChild(CuttingPlaneItem); + + QTreeWidgetItem* IsosurfaceItem = new QTreeWidgetItem(); + IsosurfaceItem->setText(0,tr("Isosurface")); + IsosurfaceItem->setData(1,0,-1); + PostProcessingItem->addChild(IsosurfaceItem); + + QTreeWidgetItem* StreamlineItem = new QTreeWidgetItem(); + StreamlineItem->setText(0,tr("Streamline")); + StreamlineItem->setData(1,0,-1); + PostProcessingItem->addChild(StreamlineItem); + + QTreeWidgetItem* DataStatisticsItem = new QTreeWidgetItem(); + DataStatisticsItem->setText(0,tr("Data Statistics")); + DataStatisticsItem->setData(1,0,-1); + PostProcessingItem->addChild(DataStatisticsItem); + + QTreeWidgetItem* ForceAndMomentItem = new QTreeWidgetItem(); + ForceAndMomentItem->setText(0,tr("Force and Moment")); + ForceAndMomentItem->setData(1,0,-1); + DataStatisticsItem->addChild(ForceAndMomentItem); + + + } + + void CFDTreeWidget::onItemClicked(QTreeWidgetItem *item, int column) + { + qDebug()<text(0); + } + + +} diff --git a/CFDStruct/CFDStructGUI/CFDTreeWidget.h b/CFDStruct/CFDStructGUI/CFDTreeWidget.h new file mode 100644 index 0000000..1acae72 --- /dev/null +++ b/CFDStruct/CFDStructGUI/CFDTreeWidget.h @@ -0,0 +1,45 @@ +#ifndef CFDTreeWidget_h +#define CFDTreeWidget_h + +#include +#include +//#include +#include +#include + +class MainWindow; +class QTabWidget; + +namespace GUI{ + + class PropertyWidget; + + class CFDStructGUIAPI CFDTreeWidget : public TreeWidget{ + Q_OBJECT + + public: + CFDTreeWidget(QWidget* parent, PropertyWidget* m_ProperWidget); + + + public: + void init(); + + void updateTree(QString s); + + void addTreePreprocessing(); + + void addTreeSolutionAnalysis(); + + void addTreePostprocessing(); + + private slots: + void onItemClicked(QTreeWidgetItem *item, int column); + + private: + PropertyWidget* m_PropertyWidget; + + }; + +} + +#endif diff --git a/GUIWidget/TreeWidget.cpp b/GUIWidget/TreeWidget.cpp index 912e6b8..280559d 100644 --- a/GUIWidget/TreeWidget.cpp +++ b/GUIWidget/TreeWidget.cpp @@ -29,6 +29,7 @@ #include #include #include +#include Q_DECLARE_METATYPE(GUI::MainTreeEnum) @@ -81,6 +82,7 @@ namespace GUI{ if (graphOper == nullptr)return; graphOper->clearHighlight(); + if (item == nullptr)return; int objID = item->data(1, 0).toInt(); GUI::MainTreeEnum treeType = item->data(2, 0).value(); @@ -120,6 +122,8 @@ namespace GUI{ case GUI::MainTreeEnum::MainTree_Post:name = "actionPost"; break; } + qDebug()<setObjectName(actions); connect(act, SIGNAL(triggered()), this, SLOT(acitonClicked())); } -} // namespace GUIOper \ No newline at end of file +} // namespace GUIOper