diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-26 13:38:32 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-29 14:09:37 +0200 |
commit | 3cebc02818d2025cda96528bbf289db15ef1bf89 (patch) | |
tree | d2d5855823c66ab46028eb53f0a55f6597bf89ee /src/gui/painting/qpainter.h | |
parent | d717d2686ecdbeafee1f5cabc6832c8339cfb2b4 (diff) | |
download | qt4-tools-3cebc02818d2025cda96528bbf289db15ef1bf89.tar.gz |
Change QStaticText::setMaximumSize() to setTextWidth()
To avoid having to precalculate the height of the laid out text, we
now only supply a maximum text width to QStaticText. The only usage of
the maximum height would be to clip the results, and clipping should be
set separately from the QStaticText call, since this has no impact on
the layout of the glyphs. The tests have been updated to reflect the
change in logic.
We also need a consistent way of specifying the position of the text.
Before, the position meant "baseline position" for unbroken text and
"top left position" for text with a specified layout width. We want
to be consistent, and since baseline position makes no sense for
multiline text, we standardize on top left position.
Task-number: QTBUG-9029
Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/painting/qpainter.h')
-rw-r--r-- | src/gui/painting/qpainter.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h index 443925b771..edfb67ecb1 100644 --- a/src/gui/painting/qpainter.h +++ b/src/gui/painting/qpainter.h @@ -396,9 +396,9 @@ public: void setLayoutDirection(Qt::LayoutDirection direction); Qt::LayoutDirection layoutDirection() const; - void drawStaticText(const QPointF &p, const QStaticText &staticText); - inline void drawStaticText(const QPoint &p, const QStaticText &staticText); - inline void drawStaticText(int x, int y, const QStaticText &staticText); + void drawStaticText(const QPointF &topLeftPosition, const QStaticText &staticText); + inline void drawStaticText(const QPoint &topLeftPosition, const QStaticText &staticText); + inline void drawStaticText(int left, int top, const QStaticText &staticText); void drawText(const QPointF &p, const QString &s); inline void drawText(const QPoint &p, const QString &s); |