summaryrefslogtreecommitdiffstats
path: root/tests/auto/qitemdelegate
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-06-10 13:46:23 +0200
committerRobert Griebl <rgriebl@trolltech.com>2009-06-10 13:46:23 +0200
commit7604f8087f88171ef933d8ae08f501467e647338 (patch)
tree51d071f462ed48d0b25884d9f62b8ba11c5dff13 /tests/auto/qitemdelegate
parent8c265860b41214daade7c8a28237c1e07ea71a3c (diff)
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels
Diffstat (limited to 'tests/auto/qitemdelegate')
-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 615ac01e74..955760a63b 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);
+ }
}