summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qstatictext_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-08-03 13:49:20 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 12:48:17 (GMT)
commite459416e357c86f32146de4e7dce220153a132b2 (patch)
tree381b855ea401ff3f288bebcd43a94b5cbb595548 /src/gui/text/qstatictext_p.h
parent30245b9fcfadaa7b400993aff05f8d1a54bea8d8 (diff)
downloadQt-e459416e357c86f32146de4e7dce220153a132b2.zip
Qt-e459416e357c86f32146de4e7dce220153a132b2.tar.gz
Qt-e459416e357c86f32146de4e7dce220153a132b2.tar.bz2
Optimize QStaticText for one line strings
QTextLayout takes a lot of memory. We can get a bigger speed-up and a more reasonable memory consumption by only supporting the single line static texts and caching the text items. We need to copy some structs from the text engine, since this is on the stack.
Diffstat (limited to 'src/gui/text/qstatictext_p.h')
-rw-r--r--src/gui/text/qstatictext_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 773971a..aaaf300 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -67,9 +67,12 @@ public:
void init();
- QTextLayout *textLayout;
- QSizeF size;
QAtomicInt ref;
+ QVector<QTextItemInt *> items;
+ QString text;
+ QFont font;
+ char *glyphLayoutMemory;
+ unsigned short *logClusterMemory;
static QStaticTextPrivate *get(const QStaticText *q);
};