diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-26 12:38:32 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-29 12:09:37 (GMT) |
commit | 3cebc02818d2025cda96528bbf289db15ef1bf89 (patch) | |
tree | d2d5855823c66ab46028eb53f0a55f6597bf89ee /src/gui/text/qstatictext_p.h | |
parent | d717d2686ecdbeafee1f5cabc6832c8339cfb2b4 (diff) | |
download | Qt-3cebc02818d2025cda96528bbf289db15ef1bf89.zip Qt-3cebc02818d2025cda96528bbf289db15ef1bf89.tar.gz Qt-3cebc02818d2025cda96528bbf289db15ef1bf89.tar.bz2 |
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/text/qstatictext_p.h')
-rw-r--r-- | src/gui/text/qstatictext_p.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h index e758244..3bbc61f 100644 --- a/src/gui/text/qstatictext_p.h +++ b/src/gui/text/qstatictext_p.h @@ -122,7 +122,7 @@ public: QString text; // 4 bytes per text QFont font; // 8 bytes per text - QSizeF maximumSize; // 16 bytes per text + qreal textWidth; // 8 bytes per text QSizeF actualSize; // 16 bytes per text QPointF position; // 16 bytes per text @@ -132,11 +132,10 @@ public: glyph_t *glyphPool; // 4 bytes per text QFixedPoint *positionPool; // 4 bytes per text - unsigned char needsClipRect : 1; // 1 byte per text - unsigned char useBackendOptimizations : 1; + unsigned char useBackendOptimizations : 1; // 1 byte per text unsigned char textFormat : 2; // ================ - // 171 bytes per text + // 163 bytes per text static QStaticTextPrivate *get(const QStaticText *q); }; |