From ef2527df6803f43519a84c15f6bf2ff9f69ef25c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 20 Feb 2014 17:16:29 +0100 Subject: [PATCH] QTextObject: 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. This is public, but as of yet unreleased API. Change-Id: Ie04a561b43c91c3b2befb3cac2981821f84d5f77 Reviewed-by: Lars Knoll Reviewed-by: Gunnar Sletta Reviewed-by: Konstantin Ritt --- src/gui/text/qtextobject.cpp | 4 ++-- src/gui/text/qtextobject.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index bd1e970583..c0342c0d4e 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -1242,9 +1242,9 @@ QString QTextBlock::text() const \sa charFormat(), blockFormat() */ -QList QTextBlock::textFormats() const +QVector QTextBlock::textFormats() const { - QList formats; + QVector formats; if (!p || !n) return formats; diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h index 6a127f0315..8138854348 100644 --- a/src/gui/text/qtextobject.h +++ b/src/gui/text/qtextobject.h @@ -223,7 +223,7 @@ public: QString text() const; - QList textFormats() const; + QVector textFormats() const; const QTextDocument *document() const;