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 committed 2018-08-30 15:43:55 +02:00
1 parent bddaf9d602
commit e93a07b43b
2 files changed
+5 -2

No files matched your search

@@ -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();
}
//--------------------------------------------------------------------------------------------------
@@ -157,6 +157,7 @@ private:
int m_tableSelectionLevel;
int m_rowSelectionLevel;
bool m_isBlockingSelectionManagerChanged;
bool m_isUpdatingSelectionQModel;
caf::PdmChildArrayFieldHandle* m_previousFieldHandle;
};