summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-11-03 04:55:46 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-11-03 04:55:46 (GMT)
commitaf15292e4982c11542487d39fc76ccfb8516598f (patch)
treeaa22c66c8f6a0230fdb63162b8794e2d76155bdb /src/declarative/graphicsitems/qdeclarativetextlayout.cpp
parentb2016bbfc9c7389e7b64451417395ceba96af21f (diff)
downloadQt-af15292e4982c11542487d39fc76ccfb8516598f.zip
Qt-af15292e4982c11542487d39fc76ccfb8516598f.tar.gz
Qt-af15292e4982c11542487d39fc76ccfb8516598f.tar.bz2
Regression: QDeclarativeText does not update when text turns empty
Task-number: QTBUG-14865 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextlayout.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
index 89a2158..db5d75d 100644
--- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp
@@ -285,6 +285,19 @@ void QDeclarativeTextLayout::beginLayout()
QTextLayout::beginLayout();
}
+void QDeclarativeTextLayout::clearLayout()
+{
+ if (d && d->cached) {
+ d->cached = false;
+ d->items.clear();
+ d->positions.clear();
+ d->glyphs.clear();
+ d->chars.clear();
+ d->position = QPointF();
+ }
+ QTextLayout::clearLayout();
+}
+
void QDeclarativeTextLayout::prepare()
{
if (!d || !d->cached) {