summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2010-11-04 09:39:16 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-04 09:39:16 (GMT)
commit74d586cb6d5391b186bfa8211fbb1e33f7c20e2f (patch)
tree8a0106ed3655fbefef0cee1f43356d6eb61f46b1
parent7833534ee1fda1e80a14ace34747283aaa386114 (diff)
downloadQt-74d586cb6d5391b186bfa8211fbb1e33f7c20e2f.zip
Qt-74d586cb6d5391b186bfa8211fbb1e33f7c20e2f.tar.gz
Qt-74d586cb6d5391b186bfa8211fbb1e33f7c20e2f.tar.bz2
Give the toplevel widget a layout
This ensures that the top-level will be large enough to view the text edit.
-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 878579b..321aa22 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));
}