summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview/tst_qtreeview.cpp
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@digia.com>2010-01-25 06:19:34 (GMT)
committerJanne Koskinen <janne.p.koskinen@digia.com>2010-01-25 06:19:34 (GMT)
commit05c543c75043824e12dac17a55e89bc11e74c7a4 (patch)
tree4b9b117084b21dc9a8486befefd2f60c138c1ea4 /tests/auto/qtreeview/tst_qtreeview.cpp
parent7bc18035816a2eac15dfac4d987eb9bf43f90ef6 (diff)
parent6b79cbf5cadbaebef8be895a47ca314724afb1a1 (diff)
downloadQt-05c543c75043824e12dac17a55e89bc11e74c7a4.zip
Qt-05c543c75043824e12dac17a55e89bc11e74c7a4.tar.gz
Qt-05c543c75043824e12dac17a55e89bc11e74c7a4.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6
Diffstat (limited to 'tests/auto/qtreeview/tst_qtreeview.cpp')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 4fc6dd3..fd4815e 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -236,6 +236,7 @@ private slots:
void task248022_changeSelection();
void task245654_changeModelAndExpandAll();
void doubleClickedWithSpans();
+ void taskQTBUG_6450_selectAllWith1stColumnHidden();
};
class QtTestModel: public QAbstractItemModel
@@ -3678,5 +3679,26 @@ void tst_QTreeView::doubleClickedWithSpans()
QTRY_COMPARE(spy.count(), 2);
}
+void tst_QTreeView::taskQTBUG_6450_selectAllWith1stColumnHidden()
+{
+ QTreeWidget tree;
+ tree.setSelectionMode(QAbstractItemView::MultiSelection);
+ tree.setColumnCount(2);
+ QList<QTreeWidgetItem *> items;
+ const int nrRows = 10;
+ for (int i = 0; i < nrRows; ++i) {
+ items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("item: %1").arg(i))));
+ items.last()->setText(1, QString("is an item"));
+ }
+ tree.insertTopLevelItems(0, items);
+
+ tree.hideColumn(0);
+ tree.selectAll();
+
+ QVERIFY(tree.selectionModel()->hasSelection());
+ for (int i = 0; i < nrRows; ++i)
+ QVERIFY(tree.selectionModel()->isRowSelected(i, QModelIndex()));
+}
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"