aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext_p_p.h
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-06-07 15:56:16 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-09 01:34:54 +0200
commit3095493a4ce4bec11b9381a3d1d23f17b313332c (patch)
tree2869549eec623e38d8915c58592a235671f7a387 /src/quick/items/qquicktext_p_p.h
parentd65b660d5d7f30058efc74c7cab074641923038f (diff)
Reduce the number of unnecessary layouts on geometry changes.
Improve checks for geometry changes that don't affect layout, i.e width increasing when the previous layout didn't wrap or elide. Set implicit sizes just once during layout rather than setting the implicit width during and the implicit height after to limit the when an implicit size change can change geometry. And if there are multiple layouts of the same text/font combination re-use cached layout data as much as possible by guarding against unnecessary property changes on the layout, and not creating a new layout for calculating the implicit size of truncated text. Change-Id: Ia05e52e9170e1f5d3364896ab119e00d8a318299 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktext_p_p.h')
-rw-r--r--src/quick/items/qquicktext_p_p.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h
index 985b1e1c80..49d3580578 100644
--- a/src/quick/items/qquicktext_p_p.h
+++ b/src/quick/items/qquicktext_p_p.h
@@ -121,6 +121,8 @@ public:
QThread *paintingThread;
#endif
+ qreal lineWidth;
+
QRgb color;
QRgb linkColor;
QRgb styleColor;
@@ -146,9 +148,12 @@ public:
bool updateOnComponentComplete:1;
bool richText:1;
bool styledText:1;
- bool singleline:1;
+ bool widthExceeded:1;
+ bool heightExceeded:1;
bool internalWidthUpdate:1;
- bool requireImplicitWidth:1;
+ bool requireImplicitSize:1;
+ bool implicitWidthValid:1;
+ bool implicitHeightValid:1;
bool truncated:1;
bool hAlignImplicit:1;
bool rightToLeftText:1;
@@ -160,10 +165,11 @@ public:
static const QChar elideChar;
virtual qreal getImplicitWidth() const;
+ virtual qreal getImplicitHeight() const;
void ensureDoc();
- QRectF setupTextLayout(qreal *const naturalWidth, qreal * const baseline);
+ QRectF setupTextLayout(qreal * const baseline);
void setupCustomLineGeometry(QTextLine &line, qreal &height, int lineOffset = 0);
bool isLinkActivatedConnected();
static QString anchorAt(const QTextLayout *layout, const QPointF &mousePos);