summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qstatictext.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-26 12:38:32 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-29 12:09:37 (GMT)
commit3cebc02818d2025cda96528bbf289db15ef1bf89 (patch)
treed2d5855823c66ab46028eb53f0a55f6597bf89ee /src/gui/text/qstatictext.h
parentd717d2686ecdbeafee1f5cabc6832c8339cfb2b4 (diff)
downloadQt-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.h')
-rw-r--r--src/gui/text/qstatictext.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index 00d42e0..c37194c 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -66,7 +66,7 @@ public:
};
QStaticText();
- QStaticText(const QString &text, const QSizeF &maximumSize = QSizeF());
+ QStaticText(const QString &text);
QStaticText(const QStaticText &other);
~QStaticText();
@@ -76,8 +76,8 @@ public:
void setTextFormat(Qt::TextFormat textFormat);
Qt::TextFormat textFormat() const;
- void setMaximumSize(const QSizeF &maximumSize);
- QSizeF maximumSize() const;
+ void setTextWidth(qreal textWidth);
+ qreal textWidth() const;
QSizeF size() const;