summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextlayout
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-06-01 01:37:05 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-06-01 01:37:05 (GMT)
commit06df53baf46ea7968b23f8b325990d047b5a67a5 (patch)
treedd54bb1d6133987235bbf6e5d2ab5b7d514dfe09 /tests/auto/qtextlayout
parentff93c3562f2b73abb69b1698f71fc9538ca5d999 (diff)
parent283e899c7d57c003facc5ed8aef8e5dacf2eb945 (diff)
downloadQt-06df53baf46ea7968b23f8b325990d047b5a67a5.zip
Qt-06df53baf46ea7968b23f8b325990d047b5a67a5.tar.gz
Qt-06df53baf46ea7968b23f8b325990d047b5a67a5.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto/qtextlayout')
-rw-r--r--tests/auto/qtextlayout/tst_qtextlayout.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qtextlayout/tst_qtextlayout.cpp b/tests/auto/qtextlayout/tst_qtextlayout.cpp
index caf9bd3..1a5f493 100644
--- a/tests/auto/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/qtextlayout/tst_qtextlayout.cpp
@@ -110,6 +110,8 @@ private slots:
void longText();
void widthOfTabs();
void columnWrapWithTabs();
+ void boundingRectForUnsetLineWidth();
+ void boundingRectForSetLineWidth();
// QTextLine stuff
void setNumColumnsWrapAtWordBoundaryOrAnywhere();
@@ -1307,6 +1309,29 @@ void tst_QTextLayout::columnWrapWithTabs()
}
+void tst_QTextLayout::boundingRectForUnsetLineWidth()
+{
+ QTextLayout layout("FOOBAR");
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ QCOMPARE(layout.boundingRect().width(), line.naturalTextWidth());
+}
+
+void tst_QTextLayout::boundingRectForSetLineWidth()
+{
+ QTextLayout layout("FOOBAR");
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ line.setLineWidth(QFIXED_MAX - 1);
+ layout.endLayout();
+
+ QCOMPARE(layout.boundingRect().width(), qreal(QFIXED_MAX - 1));
+}
+
void tst_QTextLayout::lineWidthFromBOM()
{
const QString string(QChar(0xfeff)); // BYTE ORDER MARK