summaryrefslogtreecommitdiffstats
path: root/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-08-11 08:45:54 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-08-11 08:45:54 +1000
commit6bb93ab2fd79ae0a04c826d9027503b644b6e374 (patch)
tree060d9765cf3f009c86fe6e421dac4ea8930d076e /tests/auto/qplaintextedit/tst_qplaintextedit.cpp
parent40db84c97769141f3f2351de1b2d5c64904fe5c2 (diff)
parent6c3c9d812a730d5bc1bcd6261befe077a65be594 (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests/auto/qplaintextedit/tst_qplaintextedit.cpp')
-rw-r--r--tests/auto/qplaintextedit/tst_qplaintextedit.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
index 40ad539ee..e8350e39b 100644
--- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
@@ -856,7 +856,12 @@ void tst_QPlainTextEdit::lineWrapModes()
ed->setLineWrapMode(QPlainTextEdit::NoWrap);
QCOMPARE(lineCount(), 1);
ed->setLineWrapMode(QPlainTextEdit::WidgetWidth);
- ed->resize(1, 1000);
+
+ // QPlainTextEdit does lazy line layout on resize, only for the visible blocks.
+ // We thus need to make it wide enough to show something visible.
+ int minimumWidth = 2 * ed->document()->documentMargin();
+ minimumWidth += ed->fontMetrics().width(QLatin1Char('a'));
+ ed->resize(minimumWidth, 1000);
QCOMPARE(lineCount(), 26);
ed->setParent(0);
delete window;