summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextedit
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2010-11-05 13:22:20 +0100
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-05 13:22:20 +0100
commit89a26ec7ecb758b635087899418eeb703138c482 (patch)
tree3a606b49d03f4e0ccaf945e2d0a0ae564935f2d8 /tests/auto/qtextedit
parent60b09b8915e2095b221eb0a16a76d49e5bb10391 (diff)
Hide the cursor in the tested text edit
Hiding the cursor will make the image comparison more robust. This fixes the sporadic test fail we saw on some machines - every time the blinking cursor was visible, the test failed. Reviewed-by: Robert Griebl
Diffstat (limited to 'tests/auto/qtextedit')
-rw-r--r--tests/auto/qtextedit/tst_qtextedit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp
index 321aa22821..d1832d8cb5 100644
--- a/tests/auto/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/qtextedit/tst_qtextedit.cpp
@@ -2163,6 +2163,9 @@ void tst_QTextEdit::noWrapBackgrounds()
QTextEdit edit;
edit.setLineWrapMode(QTextEdit::NoWrap);
+ // hide the cursor in order to make the image comparison below reliable
+ edit.setCursorWidth(0);
+
QTextFrame *root = edit.document()->rootFrame();
QTextFrameFormat frameFormat = root->frameFormat();
frameFormat.setLeftMargin(2);
@@ -2178,8 +2181,6 @@ void tst_QTextEdit::noWrapBackgrounds()
layout->addWidget(&edit);
topLevel.show();
- QTest::qWait(1000);
-
QImage img = QPixmap::grabWidget(edit.viewport()).toImage();
QCOMPARE(img, img.mirrored(true, false));
}