算法没有输出曲线时也刷新左侧树

This commit is contained in:
zhaolei 2026-06-24 13:56:37 +08:00
parent b60f03a7a4
commit 795e1c09f4
2 changed files with 9 additions and 9 deletions

View File

@ -2268,10 +2268,10 @@ void QtProjectWidgets::onPasteSelObject() // 粘贴
{
QTreeWidgetItem *parentItem = pItem/*->parent()*/; // 上一层目录是井次
if (parentItem && "wellItem" == parentItem->data(0, Qt::UserRole).toString() && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
RefreshWellRoundTree(parentItem);
RefreshWellRoundTree(parentItem, m_strSlfName);
parentItem = parentItem = pItem->parent();
if (parentItem && "wellItem" == parentItem->data(0, Qt::UserRole).toString() && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
RefreshWellRoundTree(parentItem);
RefreshWellRoundTree(parentItem, m_strSlfName);
break;
}
@ -2365,15 +2365,15 @@ void QtProjectWidgets::onPasteWell()
}
//刷新井次树
void QtProjectWidgets::RefreshWellRoundTree(QTreeWidgetItem *parentItem)
void QtProjectWidgets::RefreshWellRoundTree(QTreeWidgetItem *parentItem, QString strSlfName)
{
if (parentItem && "wellItem" == parentItem->data(0, Qt::UserRole).toString() && m_strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
if (parentItem && "wellItem" == parentItem->data(0, Qt::UserRole).toString() && strSlfName == parentItem->data(0, Qt::UserRole+1).toString())
{
// qDeleteAll(parentItem->takeChildren());
QTreeWidgetItem *pWellItem = parentItem->parent();
QString Wellname = parentItem->text(0);
// parentItem->setExpanded(false);
loadWellTree(parentItem->parent(), m_strSlfName, Wellname);
loadWellTree(parentItem->parent(), strSlfName, Wellname);
pWellItem->removeChild(parentItem);
pWellItem->setExpanded(true);
@ -2381,7 +2381,7 @@ void QtProjectWidgets::RefreshWellRoundTree(QTreeWidgetItem *parentItem)
for (int i = 0; i < WellCount; ++i)
{
QTreeWidgetItem *childItem = pWellItem->child(i);
if (childItem && m_strSlfName == childItem->data(0, Qt::UserRole+1).toString())
if (childItem && strSlfName == childItem->data(0, Qt::UserRole+1).toString())
{
childItem->setExpanded(true);
int childCount = childItem->childCount();
@ -3227,7 +3227,7 @@ void QtProjectWidgets::s_Notice_AddObject(QString strName, QString strSlfName, Q
}
}
}
if (listExistObject.count()!=listObject.count())
RefreshWellRoundTree(wellCurItem);
if (listExistObject.count()!=listObject.count() || 0==listObject.count())
RefreshWellRoundTree(wellCurItem,strSlfName);
}
}

View File

@ -94,7 +94,7 @@ public slots:
void onPasteSelObject(); // 粘贴
void onReNameObject(); // 重命名
void onPasteWell(); // 粘贴井次
void RefreshWellRoundTree(QTreeWidgetItem *parentItem); // 刷新井次树
void RefreshWellRoundTree(QTreeWidgetItem *parentItem, QString strSlfName); // 刷新井次树
//向左侧树图,追加固井结论表格
void s_AddGujingToTree(QString strSlfName, QString strWellName, QString strLineName);