diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-08-04 11:41:36 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-14 12:48:58 (GMT) |
commit | 4cfca7cf456722ee8659b595f231f3cc2033b80d (patch) | |
tree | 696924de1d76bfabf14b5c9f91b9a938ab55983b /src/gui/text/qtextengine_p.h | |
parent | c8621912c17ed15446da2f25760868bc177808c0 (diff) | |
download | Qt-4cfca7cf456722ee8659b595f231f3cc2033b80d.zip Qt-4cfca7cf456722ee8659b595f231f3cc2033b80d.tar.gz Qt-4cfca7cf456722ee8659b595f231f3cc2033b80d.tar.bz2 |
Speed optimization for QStaticText
Don't use QVector to store the text items, but put them in a regular
array for quick access.
drawStaticText() is now about 2.7 times the speed of drawText().
Diffstat (limited to 'src/gui/text/qtextengine_p.h')
-rw-r--r-- | src/gui/text/qtextengine_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 2edbd98..0491d87 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -312,7 +312,9 @@ public: : justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(0), logClusters(0), f(0), fontEngine(0) {} + QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat()); + void init(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat()); /// copy the structure items, adjusting the glyphs arrays to the right subarrays. /// the width of the returned QTextItemInt is not adjusted, for speed reasons |