Fix missing blocking of selection manager update when updating table selection

Caused crash in the Well Path editing (dragging targets)
This commit is contained in:
Jacob Støren 2018-08-30 15:43:24 +02:00
parent bddaf9d602
commit e93a07b43b
2 changed files with 5 additions and 2 deletions

View File

@ -298,8 +298,10 @@ void PdmUiTableViewEditor::onSelectionManagerSelectionChanged(int selectionLevel
QItemSelection itemSelection = m_tableModelPdm->modelIndexFromPdmObject(pdmObj);
totalSelection.merge(itemSelection, QItemSelectionModel::Select);
}
m_isUpdatingSelectionQModel = true;
m_tableView->selectionModel()->select(totalSelection, QItemSelectionModel::SelectCurrent);
m_isUpdatingSelectionQModel = false;
}
}
@ -310,7 +312,7 @@ void PdmUiTableViewEditor::onSelectionManagerSelectionChanged(int selectionLevel
//--------------------------------------------------------------------------------------------------
void PdmUiTableViewEditor::slotSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected)
{
updateSelectionManagerFromTableSelection();
if (!m_isUpdatingSelectionQModel) updateSelectionManagerFromTableSelection();
}
//--------------------------------------------------------------------------------------------------

View File

@ -157,6 +157,7 @@ private:
int m_tableSelectionLevel;
int m_rowSelectionLevel;
bool m_isBlockingSelectionManagerChanged;
bool m_isUpdatingSelectionQModel;
caf::PdmChildArrayFieldHandle* m_previousFieldHandle;
};