From 89a26ec7ecb758b635087899418eeb703138c482 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Fri, 5 Nov 2010 13:22:20 +0100 Subject: 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 --- tests/auto/qtextedit/tst_qtextedit.cpp | 5 +++-- 1 file 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)); } -- cgit v0.12