summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-05-21 10:38:40 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-05-21 10:38:40 +0200
commite5e40e6eb10e6760c6fac3673aa0a5afe074ae9b (patch)
tree6638c6ea58eeed115e04aa53143bf6326c3de442 /tests
parentef3560410f9ee5c851ef46298e38297a7ed42994 (diff)
Revert "Deselect the current selection when the QItemSelectionModel::model is reset."
This reverts commit 2c1d1c136102a17eef9ae3c4e9f0cf01338306ae. Regressions: TESTCASE_FAIL qtreeview (pulse_win32-msvc2005_windows_xp) TESTCASE_FAIL qtreeview (pulse_win32-msvc2008_windows_xp) TESTCASE_FAIL qtreewidget (pulse_win32-msvc2005_windows_xp) TESTCASE_FAIL qtreewidget (pulse_win32-msvc2008_windows_xp) TESTFUNCTION_FAIL qitemselectionmodel::unselectable (pulse_linux-g++) TESTFUNCTION_FAIL qitemselectionmodel::unselectable (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_linux-g++) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_macx-g++_cocoa_32) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_win32-msvc2005_windows_xp) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_win32-msvc2008_windows_xp) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_linux-g++) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_win32-msvc2005_windows_xp) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_win32-msvc2008_windows_xp) TESTFUNCTION_FAIL qtreewidget::task191552_rtl (pulse_linux-g++) TESTFUNCTION_FAIL qtreewidget::task203673_selection (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qtreewidget::task203673_selection (pulse_win32-msvc2005_windows_xp) TESTFUNCTION_FAIL qtreewidget::task203673_selection (pulse_win32-msvc2008_windows_xp)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp47
1 files changed, 4 insertions, 43 deletions
diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 9858829936..3b2a7167c0 100644
--- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -1536,43 +1536,6 @@ public:
inline void reset() { QStandardItemModel::reset(); }
};
-class ResetObserver : public QObject
-{
- QItemSelectionModel * const m_selectionModel;
- QItemSelection m_selection;
- Q_OBJECT
-public:
- ResetObserver(QItemSelectionModel *selectionModel)
- : m_selectionModel(selectionModel)
- {
- connect(selectionModel->model(), SIGNAL(modelAboutToBeReset()),SLOT(modelAboutToBeReset()));
- connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged(QItemSelection,QItemSelection)));
- connect(selectionModel->model(), SIGNAL(modelReset()),SLOT(modelReset()));
- }
-
-private slots:
- void modelAboutToBeReset()
- {
- m_selection = m_selectionModel->selection();
- foreach(const QItemSelectionRange &range, m_selection)
- {
- QVERIFY(range.isValid());
- }
- }
-
- void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
- {
- qDebug() << deselected << selected;
- QCOMPARE(m_selection, deselected);
- m_selection.clear();
- }
-
- void modelReset()
- {
- QVERIFY(m_selectionModel->selection().isEmpty());
- }
-};
-
void tst_QItemSelectionModel::resetModel()
{
MyStandardItemModel model(20, 20);
@@ -1592,13 +1555,11 @@ void tst_QItemSelectionModel::resetModel()
view.selectionModel()->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select);
- // We get this signal three times. Twice in this test method and once because the source reset causes the current selection to
- // be deselected.
- QCOMPARE(spy.count(), 3);
- QCOMPARE(spy.at(2).count(), 2);
+ QCOMPARE(spy.count(), 2);
+ QCOMPARE(spy.at(1).count(), 2);
// make sure we don't get an "old selection"
- QCOMPARE(spy.at(2).at(1).userType(), qMetaTypeId<QItemSelection>());
- QVERIFY(qvariant_cast<QItemSelection>(spy.at(2).at(1)).isEmpty());
+ QCOMPARE(spy.at(1).at(1).userType(), qMetaTypeId<QItemSelection>());
+ QVERIFY(qvariant_cast<QItemSelection>(spy.at(1).at(1)).isEmpty());
}
void tst_QItemSelectionModel::removeRows_data()