diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2011-02-07 07:23:42 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2011-02-09 00:20:47 (GMT) |
commit | ccd1b7dd5c8e6b1c4bf5b21354f7b9acaf881b00 (patch) | |
tree | 70fff5170c32335a78e9b4fb3856cdf60b78f5cd /src/declarative | |
parent | f7e789710568d263816f50bd5782cc7adec41249 (diff) | |
download | Qt-ccd1b7dd5c8e6b1c4bf5b21354f7b9acaf881b00.zip Qt-ccd1b7dd5c8e6b1c4bf5b21354f7b9acaf881b00.tar.gz Qt-ccd1b7dd5c8e6b1c4bf5b21354f7b9acaf881b00.tar.bz2 |
Use same values for Text.lineHeightMode and QTextBlock::lineHeightMode from master.
- MultiplyHeight becomes ProportionalHeight
- PixelHeight becomes FixedHeight
Change-Id: I2a1ebc6ff9db7e62f513919f19773f985b08f8d7
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext.cpp | 12 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetext_p.h | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp index 54b4c3a..4c6c34f 100644 --- a/src/declarative/graphicsitems/qdeclarativetext.cpp +++ b/src/declarative/graphicsitems/qdeclarativetext.cpp @@ -99,7 +99,8 @@ QString QDeclarativeTextPrivate::elideChar = QString(0x2026); QDeclarativeTextPrivate::QDeclarativeTextPrivate() : color((QRgb)0), style(QDeclarativeText::Normal), hAlign(QDeclarativeText::AlignLeft), vAlign(QDeclarativeText::AlignTop), elideMode(QDeclarativeText::ElideNone), - format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap), lineHeight(1), lineHeightMode(QDeclarativeText::MultiplyHeight), + format(QDeclarativeText::AutoText), wrapMode(QDeclarativeText::NoWrap), lineHeight(1), + lineHeightMode(QDeclarativeText::ProportionalHeight), lineCount(1), truncated(false), maximumLineCount(INT_MAX), maximumLineCountValid(false), imageCacheDirty(true), updateOnComponentComplete(true), richText(false), singleline(false), cacheAllTextAsImage(true), internalWidthUpdate(false), requireImplicitWidth(false), naturalWidth(0), doc(0) @@ -189,7 +190,7 @@ QDeclarativeTextDocumentLayout::QDeclarativeTextDocumentLayout(QTextDocument *do : QTextDocumentLayout(doc) { } -void QDeclarativeTextDocumentLayout::setLineHeight(qreal lineHeight, QDeclarativeText::LineHeightMode mode = QDeclarativeText::MultiplyHeight) +void QDeclarativeTextDocumentLayout::setLineHeight(qreal lineHeight, QDeclarativeText::LineHeightMode mode = QDeclarativeText::ProportionalHeight) { QTextDocumentLayout::setLineHeight(lineHeight, QTextDocumentLayout::LineHeightMode(mode)); } @@ -468,7 +469,7 @@ QSize QDeclarativeTextPrivate::setupTextLayout() for (int i = 0; i < layout.lineCount(); ++i) { QTextLine line = layout.lineAt(i); line.setPosition(QPointF(0, height)); - height += (lineHeightMode == QDeclarativeText::PixelHeight) ? lineHeight : line.height() * lineHeight; + height += (lineHeightMode == QDeclarativeText::FixedHeight) ? lineHeight : line.height() * lineHeight; if (!cacheAllTextAsImage) { if ((hAlignment == QDeclarativeText::AlignLeft) || (hAlignment == QDeclarativeText::AlignJustify)) { @@ -1461,8 +1462,9 @@ void QDeclarativeText::setLineHeight(qreal lineHeight) The possible values are: \list - \o Text.MultiplyHeight (default) - specifies a line height multiplier, - \o Text.PixelHeight - specifies the line height in pixels. + \o Text.ProportionalHeight (default) - this sets the spacing proportional to the + line (as a multiplier). For example, set to 2 for double spacing. + \o Text.FixedHeight - this sets the line height to a fixed line height (in pixels). \endlist */ QDeclarativeText::LineHeightMode QDeclarativeText::lineHeightMode() const diff --git a/src/declarative/graphicsitems/qdeclarativetext_p.h b/src/declarative/graphicsitems/qdeclarativetext_p.h index f3697d5..b8835d1 100644 --- a/src/declarative/graphicsitems/qdeclarativetext_p.h +++ b/src/declarative/graphicsitems/qdeclarativetext_p.h @@ -114,7 +114,7 @@ public: Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere }; - enum LineHeightMode { MultiplyHeight, PixelHeight }; + enum LineHeightMode { ProportionalHeight, FixedHeight }; QString text() const; void setText(const QString &); |