diff options
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 4 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext_p_p.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 200a680..9a281e5 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -772,7 +772,7 @@ void QDeclarativeText::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { Q_D(QDeclarativeText); - if (newGeometry.width() != oldGeometry.width()) { + if (!d->internalWidthUpdate && newGeometry.width() != oldGeometry.width()) { if (d->wrapMode != QDeclarativeText::NoWrap || d->elideMode != QDeclarativeText::ElideNone) { //re-elide if needed if (d->singleline && d->elideMode != QDeclarativeText::ElideNone && @@ -872,7 +872,9 @@ void QDeclarativeTextPrivate::updateSize() q->setBaselineOffset(fm.ascent() + yoff); //### need to comfirm cost of always setting these for richText + internalWidthUpdate = true; q->setImplicitWidth(size.width()); + internalWidthUpdate = false; q->setImplicitHeight(size.height()); emit q->paintedSizeChanged(); } else { diff --git a/src/declarative/graphicsitems/qdeclarativetext_p_p.h b/src/declarative/graphicsitems/qdeclarativetext_p_p.h index 51a5514..48552a7 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p_p.h @@ -72,7 +72,7 @@ public: QDeclarativeTextPrivate() : color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft), vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone), - imgDirty(true), dirty(true), richText(false), singleline(false), cache(true), doc(0), + imgDirty(true), dirty(true), richText(false), singleline(false), cache(true), internalWidthUpdate(false), doc(0), format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap) { #if defined(QML_NO_TEXT_CACHE) @@ -119,6 +119,7 @@ public: bool richText:1; bool singleline:1; bool cache:1; + bool internalWidthUpdate:1; QTextDocumentWithImageResources *doc; QTextLayout layout; QSize cachedLayoutSize; |