summaryrefslogtreecommitdiffstats
path: root/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qitemdelegate/tst_qitemdelegate.cpp')
-rw-r--r--tests/auto/qitemdelegate/tst_qitemdelegate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
index 615ac01..955760a 100644
--- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp
@@ -1115,13 +1115,16 @@ void tst_QItemDelegate::enterKey()
QList<QWidget*> lineEditors = qFindChildren<QWidget *>(view.viewport(), QString::fromLatin1("TheEditor"));
QCOMPARE(lineEditors.count(), 1);
- QWidget *editor = lineEditors.at(0);
+ QPointer<QWidget> editor = lineEditors.at(0);
QCOMPARE(editor->hasFocus(), true);
QTest::keyClick(editor, Qt::Key(key));
QApplication::processEvents();
- QCOMPARE(editor->hasFocus(), expectedFocus);
+ if (widget == 2 || widget == 3) {
+ QVERIFY(!editor.isNull());
+ QCOMPARE(editor->hasFocus(), expectedFocus);
+ }
}