diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-06 06:38:11 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-06 07:18:48 (GMT) |
commit | 55c4f15df0d482c7d3d6c889b9fc132ed0bdd12a (patch) | |
tree | 99c01d7a4e0941f415e9a48f51faac94787b6cb0 /tests/auto/qitemdelegate/tst_qitemdelegate.cpp | |
parent | 57ceb11ecf95032418712a686418116cf2398e7a (diff) | |
parent | b008dfbd67176948f6fdf830dc99d23a538a6b9c (diff) | |
download | Qt-55c4f15df0d482c7d3d6c889b9fc132ed0bdd12a.zip Qt-55c4f15df0d482c7d3d6c889b9fc132ed0bdd12a.tar.gz Qt-55c4f15df0d482c7d3d6c889b9fc132ed0bdd12a.tar.bz2 |
Merge commit 'qt/master-stable'
Conflicts:
configure.exe
doc/src/classes/qnamespace.qdoc
examples/examples.pro
src/corelib/kernel/qcoreevent.cpp
src/corelib/kernel/qobject.cpp
src/gui/kernel/qapplication.cpp
src/gui/kernel/qstandardgestures.h
src/gui/kernel/qwidget.cpp
Diffstat (limited to 'tests/auto/qitemdelegate/tst_qitemdelegate.cpp')
-rw-r--r-- | tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index df0853b..31247b3 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -61,6 +61,7 @@ #include <QAbstractItemDelegate> #include <QTextEdit> #include <QPlainTextEdit> +#include <QDialog> Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint) @@ -230,6 +231,8 @@ private slots: void editorEvent(); void enterKey_data(); void enterKey(); + + void task257859_finalizeEdit(); }; @@ -1127,6 +1130,36 @@ void tst_QItemDelegate::enterKey() } } +void tst_QItemDelegate::task257859_finalizeEdit() +{ + QStandardItemModel model; + model.appendRow(new QStandardItem()); + + QListView view; + view.setModel(&model); + view.show(); + QApplication::setActiveWindow(&view); + view.setFocus(); + QTest::qWait(30); + + QModelIndex index = model.index(0, 0); + view.edit(index); + QTest::qWait(30); + + QList<QWidget*> lineEditors = qFindChildren<QWidget *>(view.viewport()); + QCOMPARE(lineEditors.count(), 1); + + QPointer<QWidget> editor = lineEditors.at(0); + QCOMPARE(editor->hasFocus(), true); + + QDialog dialog; + QTimer::singleShot(100, &dialog, SLOT(close())); + dialog.exec(); + + QTest::qWait(10); + + QVERIFY(!editor); +} // ### _not_ covered: |