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 <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
bb10
Marc Mutz 2014-02-20 17:16:29 +01:00 committed by The Qt Project
parent 42afcfd8ce
commit ef2527df68
2 changed files with 3 additions and 3 deletions

View File

@ -1242,9 +1242,9 @@ QString QTextBlock::text() const
\sa charFormat(), blockFormat()
*/
QList<QTextLayout::FormatRange> QTextBlock::textFormats() const
QVector<QTextLayout::FormatRange> QTextBlock::textFormats() const
{
QList<QTextLayout::FormatRange> formats;
QVector<QTextLayout::FormatRange> formats;
if (!p || !n)
return formats;

View File

@ -223,7 +223,7 @@ public:
QString text() const;
QList<QTextLayout::FormatRange> textFormats() const;
QVector<QTextLayout::FormatRange> textFormats() const;
const QTextDocument *document() const;