aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextutil_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/qquicktextutil_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/qquicktextutil_p.h')
-rw-r--r--src/quick/items/qquicktextutil_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextutil_p.h b/src/quick/items/qquicktextutil_p.h
index d6c05aac3b..21435c31f8 100644
--- a/src/quick/items/qquicktextutil_p.h
+++ b/src/quick/items/qquicktextutil_p.h
@@ -66,8 +66,9 @@ public:
template <typename Private> static void setCursorDelegate(Private *d, QQmlComponent *delegate);
template <typename Private> static void createCursor(Private *d);
- static qreal alignedX(const QRectF &rect, qreal width, int alignment);
- static qreal alignedY(const QRectF &rect, qreal height, int alignment);
+
+ static qreal alignedX(qreal textWidth, qreal itemWidth, int alignment);
+ static qreal alignedY(qreal textHeight, qreal itemHeight, int alignment);
private:
static QQuickItem *createCursor(