aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgtextnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/items/qsgtextnode.cpp')
-rw-r--r--src/declarative/items/qsgtextnode.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/declarative/items/qsgtextnode.cpp b/src/declarative/items/qsgtextnode.cpp
index 33325a14ab..610513722e 100644
--- a/src/declarative/items/qsgtextnode.cpp
+++ b/src/declarative/items/qsgtextnode.cpp
@@ -81,8 +81,7 @@ void QSGTextNode::setColor(const QColor &color)
if (m_usePixmapCache) {
setUpdateFlag(UpdateNodes);
} else {
- for (int i=0; i<childCount(); ++i) {
- QSGNode *childNode = childAtIndex(i);
+ for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) {
if (childNode->subType() == GlyphNodeSubType) {
QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode);
if (glyphNode->color() == m_color)
@@ -103,8 +102,7 @@ void QSGTextNode::setStyleColor(const QColor &styleColor)
if (m_usePixmapCache) {
setUpdateFlag(UpdateNodes);
} else {
- for (int i=0; i<childCount(); ++i) {
- QSGNode *childNode = childAtIndex(i);
+ for (QSGNode *childNode = firstChild(); childNode; childNode = childNode->nextSibling()) {
if (childNode->subType() == GlyphNodeSubType) {
QSGGlyphNode *glyphNode = static_cast<QSGGlyphNode *>(childNode);
if (glyphNode->color() == m_styleColor)
@@ -376,8 +374,8 @@ void QSGTextNode::addTextBlock(const QPointF &position, QTextDocument *textDocum
void QSGTextNode::deleteContent()
{
- while (childCount() > 0)
- delete childAtIndex(0);
+ while (firstChild() > 0)
+ delete firstChild();
}
#if 0