From d81397878a1b853054b808c898f50db19f9b80e4 Mon Sep 17 00:00:00 2001 From: simonyan <315082291@qq.com> Date: Thu, 10 Oct 2024 16:23:29 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E5=96=84=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E6=A0=91=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Include/nmNum/nmData/nmDefines.h | 10 +++++----- Src/nmNum/nmSubWxs/nmWxTreeWidget.cpp | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Include/nmNum/nmData/nmDefines.h b/Include/nmNum/nmData/nmDefines.h index 94732a4..b0a83c7 100644 --- a/Include/nmNum/nmData/nmDefines.h +++ b/Include/nmNum/nmData/nmDefines.h @@ -25,9 +25,9 @@ enum NM_TREE_TYPE { }; // 结构树油藏子节点 enum NM_TREE_OIL_RESERVOIR_TYPE { - TREE_OUTLINE, // 边界节点 - TREE_WELL, // 井节点 - TREE_FAULT, // 断层节点 - TREE_CRACK, // 裂缝节点 - TREE_REGION, // 区域节点 + TREE_Oil_Reservoir_Outline, // 边界节点 + TREE_Oil_Reservoir_Well, // 井节点 + TREE_Oil_Reservoir_Fault, // 断层节点 + TREE_Oil_Reservoir_Crack, // 裂缝节点 + TREE_Oil_Reservoir_Region, // 区域节点 }; diff --git a/Src/nmNum/nmSubWxs/nmWxTreeWidget.cpp b/Src/nmNum/nmSubWxs/nmWxTreeWidget.cpp index 9db6cec..48d330c 100644 --- a/Src/nmNum/nmSubWxs/nmWxTreeWidget.cpp +++ b/Src/nmNum/nmSubWxs/nmWxTreeWidget.cpp @@ -34,6 +34,7 @@ void nmWxTreeWidget::renderTree() } // 创建树形视图的根节点 m_treeRoot = new QTreeWidgetItem(m_treeWidget, QStringList(m_pAnalyzeData->analyzeName())); + // 一级节点 QMap nodeMap; nodeMap.insert(TREE_OilReservoir, tr("Oil Reservoir")); nodeMap.insert(TREE_Data, tr("Data")); @@ -44,7 +45,18 @@ void nmWxTreeWidget::renderTree() // qDebug() << i.key() << i.value(); QTreeWidgetItem* item = new QTreeWidgetItem(m_treeRoot, i.key()); item->setText(0, i.value()); + if (i.key() == TREE_OilReservoir) { + QMap oilNodeMap; + oilNodeMap.insert(TREE_Oil_Reservoir_Outline, tr("Outline")); + oilNodeMap.insert(TREE_Oil_Reservoir_Well, tr("Well")); + oilNodeMap.insert(TREE_Oil_Reservoir_Fault, tr("Fault")); + oilNodeMap.insert(TREE_Oil_Reservoir_Crack, tr("Crack")); + oilNodeMap.insert(TREE_Oil_Reservoir_Region, tr("Region")); + for (QMap::const_iterator j = oilNodeMap.constBegin(); j != oilNodeMap.constEnd(); ++j) { + QTreeWidgetItem* oilItem = new QTreeWidgetItem(item, j.key()); + oilItem->setText(0, j.value()); + } + } } m_treeRoot->setExpanded(true); -} - +} \ No newline at end of file