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
parent
42afcfd8ce
commit
ef2527df68
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ public:
|
|||
|
||||
QString text() const;
|
||||
|
||||
QList<QTextLayout::FormatRange> textFormats() const;
|
||||
QVector<QTextLayout::FormatRange> textFormats() const;
|
||||
|
||||
const QTextDocument *document() const;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue