diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2011-09-22 11:34:58 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-12 00:24:34 +0200 |
commit | 6fcaca378b84ada546dc62d72a53a71d0da86ef9 (patch) | |
tree | c4e16677dc694d8b4a5d9b0a9f881fb482622bc2 /src/declarative/items/qsgtext_p_p.h | |
parent | 6a9d97f03875210c5cdc88964bf770e023a2131f (diff) |
Improvements to text layouting in QML
Allow more control over the text layouting process in QML.
Give access to every text line through a hook, this gives the
opportunity to position and resize a line as it is being laid out.
It is then possible to lay out the text in columns or around other
objects.
Task-number: QTBUG-21367
Change-Id: I56dc0c1c4b575dc06360c135098024d0324d3656
Reviewed-on: http://codereview.qt-project.org/5351
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Sanity-Review: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgtext_p_p.h')
-rw-r--r-- | src/declarative/items/qsgtext_p_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/items/qsgtext_p_p.h b/src/declarative/items/qsgtext_p_p.h index ddd54b6f0c..8b83263f6f 100644 --- a/src/declarative/items/qsgtext_p_p.h +++ b/src/declarative/items/qsgtext_p_p.h @@ -80,6 +80,7 @@ public: bool setHAlign(QSGText::HAlignment, bool forceAlign = false); void mirrorChange(); QTextDocument *textDocument(); + bool isLineLaidOutConnected(); QString text; QFont font; @@ -121,6 +122,7 @@ public: bool layoutTextElided:1; bool richTextAsImage:1; bool textureImageCacheDirty:1; + bool textHasChanged:1; QRect layedOutTextRect; QSize paintedSize; @@ -132,11 +134,14 @@ public: QSGTextDocumentWithImageResources *doc; QRect setupTextLayout(); + void setupCustomLineGeometry(QTextLine &line, qreal &height, qreal elideWidth); QPixmap textLayoutImage(bool drawStyle); void drawTextLayout(QPainter *p, const QPointF &pos, bool drawStyle); bool isLinkActivatedConnected(); QString anchorAt(const QPointF &pos); QTextLayout layout; + QList<QRectF> linesRects; + QSGTextLine *textLine; static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource); static QPixmap drawOutline(const QPixmap &source, const QPixmap &styleSource, int yOffset); @@ -154,6 +159,7 @@ public: #if defined(Q_OS_MAC) QThread *layoutThread; + QThread *paintingThread; #endif }; |