diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
commit | 7604f8087f88171ef933d8ae08f501467e647338 (patch) | |
tree | 51d071f462ed48d0b25884d9f62b8ba11c5dff13 /tests/auto/qitemdelegate | |
parent | 8c265860b41214daade7c8a28237c1e07ea71a3c (diff) | |
download | Qt-7604f8087f88171ef933d8ae08f501467e647338.zip Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2 |
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.cpp | 7 |
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); + } } |