diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-05 12:22:20 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-05 12:22:20 (GMT) |
commit | 89a26ec7ecb758b635087899418eeb703138c482 (patch) | |
tree | 3a606b49d03f4e0ccaf945e2d0a0ae564935f2d8 /tests/auto | |
parent | 60b09b8915e2095b221eb0a16a76d49e5bb10391 (diff) | |
download | Qt-89a26ec7ecb758b635087899418eeb703138c482.zip Qt-89a26ec7ecb758b635087899418eeb703138c482.tar.gz Qt-89a26ec7ecb758b635087899418eeb703138c482.tar.bz2 |
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')
-rw-r--r-- | tests/auto/qtextedit/tst_qtextedit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 321aa22..d1832d8 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)); } |