diff options
author | Christian Strømme <christian.stromme@qt.io> | 2018-06-12 11:14:20 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-06-12 09:48:43 +0000 |
commit | 125f13c64ce716193db264baa2548342ca43389e (patch) | |
tree | f96dd1f6449a018b601774878ae82c9f0767347a | |
parent | 8b8ece1ab22bd96bf39c89f1bef3b2662f78dd40 (diff) |
Fix broken logic in post-processing of layers with sub-presentations
We were disabling the layer that contained the sub-presentations as
well as all it's nodes, this should of course not happen and was
causing the layer to not be shown.
Task-number: QT3DS-1912
Change-Id: I7112797ba539532f8dbc50c8ea6dd1837e368cf0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/runtime/q3dsuippresentation.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/runtime/q3dsuippresentation.cpp b/src/runtime/q3dsuippresentation.cpp index d67562f..670754d 100644 --- a/src/runtime/q3dsuippresentation.cpp +++ b/src/runtime/q3dsuippresentation.cpp @@ -3884,9 +3884,14 @@ void Q3DSUipPresentation::resolveAliases() void Q3DSUipPresentation::updateObjectStateForSubTrees() { forAllObjectsInSubTree(scene(), [](Q3DSGraphObject *obj) { - if (obj->type() == Q3DSGraphObject::Layer && !static_cast<Q3DSLayerNode *>(obj)->sourcePath().isEmpty()) { + if (obj->type() != Q3DSGraphObject::Layer) + return; + Q3DSLayerNode *layer = static_cast<Q3DSLayerNode *>(obj); + if (!layer->sourcePath().isEmpty()) { // Sub-presentation, set all objects to be inactive - forAllObjectsInSubTree(obj, [](Q3DSGraphObject *obj) { + forAllObjectsInSubTree(obj, [layer](Q3DSGraphObject *obj) { + if (obj == layer) + return; obj->m_state = Q3DSGraphObject::Disabled; }); } |