summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextedit
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2010-11-04 10:39:16 +0100
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-04 10:39:16 +0100
commit74d586cb6d5391b186bfa8211fbb1e33f7c20e2f (patch)
tree8a0106ed3655fbefef0cee1f43356d6eb61f46b1 /tests/auto/qtextedit
parent7833534ee1fda1e80a14ace34747283aaa386114 (diff)
Give the toplevel widget a layout
This ensures that the top-level will be large enough to view the text edit.
Diffstat (limited to 'tests/auto/qtextedit')
-rw-r--r--tests/auto/qtextedit/tst_qtextedit.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp
index 878579bef7..321aa22821 100644
--- a/tests/auto/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/qtextedit/tst_qtextedit.cpp
@@ -58,6 +58,7 @@
#include <qimagereader.h>
#include <qimagewriter.h>
#include <qcommonstyle.h>
+#include <qlayout.h>
#include <qabstracttextdocumentlayout.h>
#include <qtextdocumentfragment.h>
@@ -2157,7 +2158,9 @@ void tst_QTextEdit::pasteFromQt3RichText()
void tst_QTextEdit::noWrapBackgrounds()
{
QWidget topLevel;
- QTextEdit edit(&topLevel);
+ QVBoxLayout *layout = new QVBoxLayout(&topLevel);
+
+ QTextEdit edit;
edit.setLineWrapMode(QTextEdit::NoWrap);
QTextFrame *root = edit.document()->rootFrame();
@@ -2171,8 +2174,12 @@ void tst_QTextEdit::noWrapBackgrounds()
edit.textCursor().setBlockFormat(format);
edit.insertPlainText(QLatin1String(" \n \n \n \n"));
edit.setFixedSize(100, 200);
+
+ layout->addWidget(&edit);
topLevel.show();
+ QTest::qWait(1000);
+
QImage img = QPixmap::grabWidget(edit.viewport()).toImage();
QCOMPARE(img, img.mirrored(true, false));
}