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/gui/text/qtextdocumentlayout.cpp | |
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/gui/text/qtextdocumentlayout.cpp')
-rw-r--r-- | src/gui/text/qtextdocumentlayout.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp index c1c3768..a1dcb63 100644 --- a/src/gui/text/qtextdocumentlayout.cpp +++ b/src/gui/text/qtextdocumentlayout.cpp @@ -525,7 +525,7 @@ QTextDocumentLayoutPrivate::QTextDocumentLayoutPrivate() lazyLayoutStepSize(1000), lastPageCount(-1), lineH(1), - lineHeightMode(QTextDocumentLayout::MultiplyHeight) + lineHeightMode(QTextDocumentLayout::ProportionalHeight) { showLayoutProgress = true; insideDocumentChange = false; @@ -2644,7 +2644,9 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi } - QFixed lineHeight = (lineHeightMode == QTextDocumentLayout::PixelHeight) ? QFixed::fromReal(lineH) : QFixed::fromReal(line.height() * lineH); + // TODO: replace with proper line height support in 4.8 + QFixed lineHeight = (lineHeightMode == QTextDocumentLayout::FixedHeight) + ? QFixed::fromReal(lineH) : QFixed::fromReal(line.height() * lineH); if (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineHeight > layoutStruct->pageBottom) { layoutStruct->newPage(); @@ -2720,7 +2722,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi } } -void QTextDocumentLayout::setLineHeight(qreal lineH, QTextDocumentLayout::LineHeightMode mode = QTextDocumentLayout::MultiplyHeight) +void QTextDocumentLayout::setLineHeight(qreal lineH, QTextDocumentLayout::LineHeightMode mode = QTextDocumentLayout::ProportionalHeight) { Q_D(QTextDocumentLayout); d->lineH = lineH; |