From c0ddd5fa12f696838cb1d1de3f721f19a87c8509 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 20 Feb 2014 17:16:29 +0100 Subject: QTextLayout: replace a use of an inefficient QList with QVector The QTextLayout::FormatRange is larger than void* and thus should not be held in QList. Use a QVector instead. Other parts of Qt already hold FormatRanges in QVectors, so this also makes handling FormatRanges more consistent. To avoid ugly names for the getter which doesn't overload on return type alone), rename the set of function to format (from additionalFormats). [ChangeLog][QtGui][QTextLayout] Added QVector-based alternatives setFormat(), format(), and clearFormat() to setAdditionalFormats(), additionalFormats(), and clearAdditionalFormats(), resp. Change-Id: Ie04a561b43c91c3b2befb3cac2981821f84d5f77 Reviewed-by: Konstantin Ritt Reviewed-by: Simon Hausmann --- src/gui/text/qtextlayout.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/text/qtextlayout.h') diff --git a/src/gui/text/qtextlayout.h b/src/gui/text/qtextlayout.h index 47dcd388e2..ce092e0928 100644 --- a/src/gui/text/qtextlayout.h +++ b/src/gui/text/qtextlayout.h @@ -129,6 +129,9 @@ public: void setAdditionalFormats(const QList &overrides); QList additionalFormats() const; void clearAdditionalFormats(); + void setFormats(const QVector &overrides); + QVector formats() const; + void clearFormats(); void setCacheEnabled(bool enable); bool cacheEnabled() const; -- cgit v1.2.3