diff options
author | Andreas Kling <andreas.kling@nokia.com> | 2010-03-22 16:31:36 (GMT) |
---|---|---|
committer | Andreas Kling <andreas.kling@nokia.com> | 2010-03-22 16:44:39 (GMT) |
commit | 397a2680b4e7ce90a8e4f8a4617450adb5d5a37d (patch) | |
tree | 4c5c4483292706577bbd7bc535b921cda51c286c /src/gui | |
parent | 1ad46d8cc9fa30ef26c3eb109c5d75937ec78aac (diff) | |
download | Qt-397a2680b4e7ce90a8e4f8a4617450adb5d5a37d.zip Qt-397a2680b4e7ce90a8e4f8a4617450adb5d5a37d.tar.gz Qt-397a2680b4e7ce90a8e4f8a4617450adb5d5a37d.tar.bz2 |
Make QStackTextEngine cheaper to construct
Default-constructing the QFont member of QTextEngine meant getting the
QApplication::font() which is a waste of time.
Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index b826588..f2d0654 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1299,10 +1299,10 @@ QTextEngine::QTextEngine() } QTextEngine::QTextEngine(const QString &str, const QFont &f) - : fnt(f) + : text(str), + fnt(f) { init(this); - text = str; } QTextEngine::~QTextEngine() @@ -2610,10 +2610,9 @@ void QTextEngine::resolveAdditionalFormats() const } QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f) - : _layoutData(string, _memory, MemSize) + : QTextEngine(string, f), + _layoutData(string, _memory, MemSize) { - fnt = f; - text = string; stackEngine = true; layoutData = &_layoutData; } |