}
}
- if (dirty & QSGItemPrivate::ChildrenUpdateMask) {
- while (itemPriv->childContainerNode()->childCount())
- itemPriv->childContainerNode()->removeChildNode(itemPriv->childContainerNode()->childAtIndex(0));
- }
+ if (dirty & QSGItemPrivate::ChildrenUpdateMask)
+ itemPriv->childContainerNode()->removeAllChildNodes();
if (effectRefEffectivelyChanged) {
QSGNode *parent = itemPriv->clipNode;
if (dirty & QSGItemPrivate::ChildrenUpdateMask) {
QSGNode *groupNode = itemPriv->groupNode;
- if (groupNode) {
- for (int count = groupNode->childCount(); count; --count)
- groupNode->removeChildNode(groupNode->childAtIndex(0));
- }
+ if (groupNode)
+ groupNode->removeAllChildNodes();
QList<QSGItem *> orderedChildren = itemPriv->paintOrderChildItems();
int ii = 0;
/*!
- Removes \a node fromt his node's list of children.
+ Removes \a node from this node's list of children.
*/
void QSGNode::removeChildNode(QSGNode *node)
/*!
+ Removes all child nodes from this node's list of children.
+ */
+
+void QSGNode::removeAllChildNodes()
+{
+ while (!m_children.isEmpty()) {
+ QSGNode *node = m_children.takeLast();
+ node->markDirty(DirtyNodeRemoved);
+ node->m_parent = 0;
+ }
+}
+
+
+/*!
Sets the flag \a f on this node if \a enabled is true;
otherwise clears the flag.
QSGNode *parent() const { return m_parent; }
void removeChildNode(QSGNode *node);
+ void removeAllChildNodes();
void prependChildNode(QSGNode *node);
void appendChildNode(QSGNode *node);
void insertChildNodeBefore(QSGNode *node, QSGNode *before);