summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-15 13:43:49 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-15 13:43:49 (GMT)
commitc2337d7f1d3b4239c21809d664cc60009d08449c (patch)
tree9f2d08c501827b486f9c676423008a038385778d
parent4b01aa0eb6e4f13b5b3a822a9e60f88a61b4d591 (diff)
downloadQt-c2337d7f1d3b4239c21809d664cc60009d08449c.zip
Qt-c2337d7f1d3b4239c21809d664cc60009d08449c.tar.gz
Qt-c2337d7f1d3b4239c21809d664cc60009d08449c.tar.bz2
doc: Add some performance hints to the documentation
-rw-r--r--src/gui/text/qstatictext.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 79f8aa5..307d2e6 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -64,8 +64,15 @@ QT_BEGIN_NAMESPACE
The class primarily provides an optimization for cases where text and the transformations on
the painter are static over several paint events. If the text or its layout is changed
regularly, QPainter::drawText() is the more efficient alternative. Translating the painter
- will not affect the performance of drawStaticText(), but altering any other parts of the
- painter's transformation will cause the layout of the static text to be recalculated.
+ will not cause the layout of the text to be recalculated, but will cause a very small
+ performance impact on drawStaticText(). Altering any other parts of the painter's
+ transformation or the painter's font will cause the layout of the static text to be
+ recalculated. This should be avoided as often as possible to maximize the performance
+ benefit of using QStaticText.
+
+ In addition, only affine transformations are supported by drawStaticText(). Calling
+ drawStaticText() on a projected painter will perform slightly worse than using the regular
+ drawText() call, so this should be avoided.
\code
class MyWidget: public QWidget
@@ -95,8 +102,8 @@ QT_BEGIN_NAMESPACE
If you set a maximum size on the QStaticText object, this will bound the text. The text will
be formatted so that no line exceeds the given width. When the object is painted, it will
be clipped at the given size. The position of the text is decided by the argument
- passed to QPainter::drawStaticText() and can change from call to call without affecting
- performance.
+ passed to QPainter::drawStaticText() and can change from call to call with a minimal impact
+ on performance.
\sa QPainter::drawText(), QPainter::drawStaticText(), QTextLayout, QTextDocument
*/