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 | |
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')
-rw-r--r-- | src/gui/text/qtextdocumentlayout.cpp | 8 | ||||
-rw-r--r-- | src/gui/text/qtextdocumentlayout_p.h | 4 |
2 files changed, 8 insertions, 4 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; diff --git a/src/gui/text/qtextdocumentlayout_p.h b/src/gui/text/qtextdocumentlayout_p.h index efc408b..3e3e485 100644 --- a/src/gui/text/qtextdocumentlayout_p.h +++ b/src/gui/text/qtextdocumentlayout_p.h @@ -109,7 +109,9 @@ protected: void drawInlineObject(QPainter *p, const QRectF &rect, QTextInlineObject item, int posInDocument, const QTextFormat &format); virtual void timerEvent(QTimerEvent *e); - enum LineHeightMode { MultiplyHeight, PixelHeight }; + + // TODO: remove when we support line height properly in 4.8 + enum LineHeightMode { ProportionalHeight, FixedHeight }; void setLineHeight(qreal lineHeight, QTextDocumentLayout::LineHeightMode mode); private: |