diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-02-13 14:15:17 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2019-02-18 16:07:41 +0000 |
commit | ae1f591fc67b05768fb4f4a587c05d25707ac630 (patch) | |
tree | f3bd14bad174c82112ef2423711b6fb6253905f8 | |
parent | 86d2fdf89bb159033f9df142b6c98a5c4793f77e (diff) |
Fix crash when changing basic material color
Task-number: QT3DS-3005
Change-Id: I0eabbc1177cb8f94cd747817e7c6aebeb30871ff
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp index 1232939c..e7dbfe7f 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp @@ -1000,10 +1000,8 @@ bool InspectorControlModel::isTreeRebuildRequired(CInspectableBase* inspectBase) long theCount = m_inspectableBase->GetGroupCount(); auto refMaterial = getReferenceMaterial(inspectBase); - if (refMaterial != m_refMaterial) { - m_refMaterial = refMaterial; + if (refMaterial != m_refMaterial) return true; - } long refMaterialGroupCount = 0; if (refMaterial.Valid()) refMaterialGroupCount = 1; // Only the last group of the refMaterial is used @@ -1196,6 +1194,8 @@ void InspectorControlModel::rebuildTree() // Clean the old objects after reset is done so that qml will not freak out about null pointers for (int i = 0; i < deleteVector.count(); ++i) deleteVector[i]->deleteLater(); + + m_refMaterial = getReferenceMaterial(m_inspectableBase); } int InspectorControlModel::rowCount(const QModelIndex &parent) const |