From 65ef4bab4ad0ef4a45ff56de3e143a588deac364 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 14 Jun 2017 13:15:45 +0200 Subject: QQuickText: don't clear the text formats on every layout In order to fix QTBUG-21919, 6ff9ba0 added a QTextLayout::clearFormats() call to QQuickTextPrivate::updateLayout(). This patch moves that logic to clearFormats(), called from setText() and setTextFormat() in order to avoid clearing the formats on every text layout update. This allows Qt Quick Controls 2 to extend QQuickText with support for mnenonics by adding a text format range to underline the appropriate piece of text in the internal QTextLayout. Task-number: QTBUG-61422 Change-Id: I646d53f0feeeaa3c106db94f187c7accabdc6a61 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/items/qquicktext_p_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/items/qquicktext_p_p.h') diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index fde07eaf2e..957641ec0a 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -85,6 +85,7 @@ public: int lineHeightOffset() const; QString elidedText(qreal lineWidth, const QTextLine &line, QTextLine *nextLine = 0) const; void elideFormats(int start, int length, int offset, QVector *elidedFormats); + void clearFormats(); void processHoverEvent(QHoverEvent *event); -- cgit v1.2.3