Call display update once after setting toggle state for a selection of wells

p4#: 21417
This commit is contained in:
Magne Sjaastad
2013-04-25 08:47:01 +02:00
parent 6cd54f0caf
commit c0bfc9bbe1
3 changed files with 51 additions and 3 deletions

View File

@@ -1177,9 +1177,20 @@ bool RimUiTreeView::checkAndHandleToggleOfMultipleSelection()
state = Qt::Checked;
}
foreach (QModelIndex mi, selectedIndexes)
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
myModel->setObjectToggleStateForSelection(selectedIndexes, state);
caf::PdmUiTreeItem* uiItem = myModel->getTreeItemFromIndex(curr);
RimWell* well = dynamic_cast<RimWell*>(uiItem->dataObject().p());
if (well)
{
model()->setData(mi, state, Qt::CheckStateRole);
RimReservoirView* reservoirView = NULL;
well->firstAncestorOfType(reservoirView);
if (reservoirView)
{
reservoirView->createDisplayModelAndRedraw();
}
}
return true;