summaryrefslogtreecommitdiffstats
path: root/src/core/nodes
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-04-24 13:43:56 +0100
committerMike Krus <mike.krus@kdab.com>2020-04-27 11:57:33 +0100
commit6c1758d35e20655f46ba3696671068f4862c8878 (patch)
treed4b4fc2ae8f5a4512de4eb015667b024b6a8e6b9 /src/core/nodes
parentb7967a8abcdac438a1f31800b71e219e3c52c24a (diff)
parent37735f11f9437b916b194cfd48c452c7c70682f8 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/core/nodes')
-rw-r--r--src/core/nodes/qentity.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/nodes/qentity.cpp b/src/core/nodes/qentity.cpp
index 0a504b4eb..551dc685b 100644
--- a/src/core/nodes/qentity.cpp
+++ b/src/core/nodes/qentity.cpp
@@ -78,18 +78,19 @@ QString dumpNode(const Qt3DCore::QEntity *n) {
return res;
}
-QStringList dumpSG(const Qt3DCore::QEntity *n, int level = 0)
+QStringList dumpSG(const Qt3DCore::QNode *n, int level = 0)
{
QStringList reply;
- QString res = dumpNode(n);
- reply += res.rightJustified(res.length() + level * 2, ' ');
+ const auto *entity = qobject_cast<const Qt3DCore::QEntity *>(n);
+ if (entity != nullptr) {
+ QString res = dumpNode(entity);
+ reply += res.rightJustified(res.length() + level * 2, ' ');
+ level++;
+ }
const auto children = n->childNodes();
- for (auto *child: children) {
- auto *childFGNode = qobject_cast<Qt3DCore::QEntity *>(child);
- if (childFGNode != nullptr)
- reply += dumpSG(childFGNode, level + 1);
- }
+ for (auto *child: children)
+ reply += dumpSG(child, level);
return reply;
}