aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext_p_p.h
diff options
context:
space:
mode:
authorTimur Kristóf <timur.kristof@gmail.com>2019-09-27 18:07:41 +0200
committerTimur Kristóf <timur.kristof@gmail.com>2019-11-04 09:39:10 +0200
commitb25c27d37a5d5dded723946900f9a518c38385de (patch)
treebae23ac214ae9bebb394550ecfb752e138e31c6a /src/quick/items/qquicktext_p_p.h
parentbd62eff7ca551dc76cf1ec2e7eef14664f6228a5 (diff)
Add API to get more information for each line in a QML Text element
Previously there was no way to know what area is occupied by each line in a QML Text element. This commit adds new API to expose implicitWidth and isLast on QQuickTextLine for use in the lineLaidOut signal. It also adds improved documentation to the lineLaidOut signal and an example usage of the new API to the text layout example. An example use case of the new API is eg. to allow embedding timestamps and indicators within a text paragraph, to enable creating more efficient layouts. [ChangeLog][QtQuick][Text] Added new API that exposes implicitWidth, and isLast on the QQuickTextLine for use in the lineLaidOut signal. This allows the user to layout other items relative to the lines of text. Fixes: QTBUG-78277 Change-Id: Ibc754db17c78efb01468106aba32e30d70d2f4df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktext_p_p.h')
-rw-r--r--src/quick/items/qquicktext_p_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h
index c01998b100..1fbf942130 100644
--- a/src/quick/items/qquicktext_p_p.h
+++ b/src/quick/items/qquicktext_p_p.h
@@ -195,7 +195,7 @@ public:
void ensureDoc();
QRectF setupTextLayout(qreal * const baseline);
- void setupCustomLineGeometry(QTextLine &line, qreal &height, int lineOffset = 0);
+ void setupCustomLineGeometry(QTextLine &line, qreal &height, int fullLayoutTextLength, int lineOffset = 0);
bool isLinkActivatedConnected();
bool isLinkHoveredConnected();
static QString anchorAt(const QTextLayout *layout, const QPointF &mousePos);