diff options
author | David Boddie <david.boddie@nokia.com> | 2010-11-17 12:56:03 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-11-17 12:56:03 (GMT) |
commit | a34730e837bc1430011028dba11bbf5a4672789d (patch) | |
tree | e3a255dc51cada6c680d9110b855f46ba99804bd /src/declarative/graphicsitems/qdeclarativetextlayout.cpp | |
parent | b5d26bfb348b6a99529ecf9ab66845e7eacd4732 (diff) | |
parent | 88c2e6f8f9f968c6bfe4ca0c0e3e54365a3e0c82 (diff) | |
download | Qt-a34730e837bc1430011028dba11bbf5a4672789d.zip Qt-a34730e837bc1430011028dba11bbf5a4672789d.tar.gz Qt-a34730e837bc1430011028dba11bbf5a4672789d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextlayout.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextlayout.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp index 89a2158..e8da367 100644 --- a/src/declarative/graphicsitems/qdeclarativetextlayout.cpp +++ b/src/declarative/graphicsitems/qdeclarativetextlayout.cpp @@ -94,7 +94,7 @@ class DrawTextItemRecorder: public QPaintEngine if (!m_inertText->items.isEmpty()) { QStaticTextItem &last = m_inertText->items[m_inertText->items.count() - 1]; - if (last.fontEngine == ti.fontEngine && last.font == ti.font() && + if (last.fontEngine() == ti.fontEngine && last.font == ti.font() && (!m_dirtyPen || last.color == state->pen().color())) { needFreshCurrentItem = false; @@ -107,7 +107,7 @@ class DrawTextItemRecorder: public QPaintEngine if (needFreshCurrentItem) { QStaticTextItem currentItem; - currentItem.fontEngine = ti.fontEngine; + currentItem.setFontEngine(ti.fontEngine); currentItem.font = ti.font(); currentItem.charOffset = charOffset; currentItem.numChars = ti.num_chars; @@ -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) { |