From 5ea1825ec7a19a9b02eacf5c6f558536e085c510 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 17 Aug 2009 16:16:21 +0200 Subject: Some documentation fixes Clarify the use of transformations combined with static texts. --- src/gui/text/qstatictext.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index e6f2cc6..5b0b471 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -42,6 +42,7 @@ #include "qstatictext.h" #include "qstatictext_p.h" #include +#include #include @@ -60,9 +61,11 @@ QT_BEGIN_NAMESPACE more efficiently than by using QPainter::drawText() in which the layout information is recalculated with every call. - The class primarily provides an optimization for cases where text is static over several paint - events. If the text or its layout is changed regularly, QPainter::drawText() is the more - efficient alternative. + 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. \code class MyWidget: public QWidget @@ -91,7 +94,7 @@ 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 vertically at the given height. The position of the text is decided by the argument + 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. -- cgit v0.12