summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocumentlayout.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-04 10:52:40 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-04 10:52:40 (GMT)
commitac60946777c55cf19ee0fc5ae1f60d3c75146e6f (patch)
tree8c8a271c71e360d567a6a95278de1c903c1b6592 /src/gui/text/qtextdocumentlayout.cpp
parentf67f6bc8bcb2092da77905aa67942f59cd49470b (diff)
parentbc331aca61a2f212a347708c9d44a4fb092183fd (diff)
downloadQt-ac60946777c55cf19ee0fc5ae1f60d3c75146e6f.zip
Qt-ac60946777c55cf19ee0fc5ae1f60d3c75146e6f.tar.gz
Qt-ac60946777c55cf19ee0fc5ae1f60d3c75146e6f.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Conflicts: demos/declarative/samegame/SamegameCore/samegame.js mkspecs/features/symbian/default_post.prf src/declarative/qml/qdeclarativeengine.cpp src/gui/text/qtextdocumentlayout.cpp src/plugins/plugins.pro src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def src/s60installs/s60installs.pro tests/auto/declarative/declarative.pro tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp tests/auto/declarative/qmlvisual/qmlvisual.pro
Diffstat (limited to 'src/gui/text/qtextdocumentlayout.cpp')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 157b7bc..90c05da 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -513,6 +513,9 @@ public:
qreal scaleToDevice(qreal value) const;
QFixed scaleToDevice(QFixed value) const;
+
+ qreal lineH;
+ QTextDocumentLayout::LineHeightMode lineHeightMode;
};
QTextDocumentLayoutPrivate::QTextDocumentLayoutPrivate()
@@ -520,7 +523,9 @@ QTextDocumentLayoutPrivate::QTextDocumentLayoutPrivate()
cursorWidth(1),
currentLazyLayoutPosition(-1),
lazyLayoutStepSize(1000),
- lastPageCount(-1)
+ lastPageCount(-1),
+ lineH(1),
+ lineHeightMode(QTextDocumentLayout::MultiplyHeight)
{
showLayoutProgress = true;
insideDocumentChange = false;
@@ -2510,6 +2515,7 @@ static inline void getLineHeightParams(const QTextBlockFormat &blockFormat, cons
QFixed *lineAdjustment, QFixed *lineBreakHeight, QFixed *lineHeight)
{
*lineHeight = QFixed::fromReal(blockFormat.lineHeight(line.height(), scaling));
+
if (blockFormat.lineHeightType() == QTextBlockFormat::FixedHeight || blockFormat.lineHeightType() == QTextBlockFormat::MinimumHeight) {
*lineBreakHeight = *lineHeight;
if (blockFormat.lineHeightType() == QTextBlockFormat::FixedHeight)
@@ -2740,6 +2746,13 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
}
}
+void QTextDocumentLayout::setLineHeight(qreal lineH, QTextDocumentLayout::LineHeightMode mode = QTextDocumentLayout::MultiplyHeight)
+{
+ Q_D(QTextDocumentLayout);
+ d->lineH = lineH;
+ d->lineHeightMode = mode;
+}
+
void QTextDocumentLayoutPrivate::floatMargins(const QFixed &y, const QTextLayoutStruct *layoutStruct,
QFixed *left, QFixed *right) const
{