1、完善结构树的初始化状态;

feature/ribbon-menu-20240927
simonyan 1 month ago
parent 8e936464e7
commit d81397878a

@ -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, // 区域节点
};

@ -34,6 +34,7 @@ void nmWxTreeWidget::renderTree()
}
// 创建树形视图的根节点
m_treeRoot = new QTreeWidgetItem(m_treeWidget, QStringList(m_pAnalyzeData->analyzeName()));
// 一级节点
QMap<NM_TREE_TYPE, QString> 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<NM_TREE_OIL_RESERVOIR_TYPE, QString> 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<NM_TREE_OIL_RESERVOIR_TYPE, QString>::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);
}
}
Loading…
Cancel
Save