diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-13 18:55:05 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-13 18:55:05 (GMT) |
commit | 7d1e48639d6d3897e66779f22fe02d17d6c38707 (patch) | |
tree | 7abc16568274e1f54c976f890e92d73f7a00160c /tests/auto/qtreeview/tst_qtreeview.cpp | |
parent | 20e0e7a849d70139f9106f60c78fd0c736ec3c4b (diff) | |
parent | e1b03bac22f87edbbe78eba366966259be6eb0ed (diff) | |
download | Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.zip Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.tar.gz Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.tar.bz2 |
Merge branch '4.6'
Conflicts:
bin/syncqt
doc/src/deployment/deployment.qdoc
src/corelib/io/qfsfileengine_win.cpp
src/corelib/xml/qxmlstream.cpp
src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
tools/assistant/tools/assistant/centralwidget.cpp
tools/linguist/lupdate/main.cpp
Diffstat (limited to 'tests/auto/qtreeview/tst_qtreeview.cpp')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 24 |
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" |