summaryrefslogtreecommitdiffstats
path: root/tests/auto/qheaderview/tst_qheaderview.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-08-03 10:53:57 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-08-03 10:53:57 (GMT)
commitd5491ecdde14659a913c9f476f18c45f1d9489bb (patch)
tree06cc52249feda9bd9e50ca47abb8ebd676c8a309 /tests/auto/qheaderview/tst_qheaderview.cpp
parent42cdfaf86d34afeb6448723839fef70fe477deed (diff)
parenta41128af5373a0225c3548abd3eb82cd7e8f7a0e (diff)
downloadQt-d5491ecdde14659a913c9f476f18c45f1d9489bb.zip
Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.tar.gz
Qt-d5491ecdde14659a913c9f476f18c45f1d9489bb.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into lighthouse
Conflicts: configure
Diffstat (limited to 'tests/auto/qheaderview/tst_qheaderview.cpp')
-rw-r--r--tests/auto/qheaderview/tst_qheaderview.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp
index f6cd4e3..da0a0bb 100644
--- a/tests/auto/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/qheaderview/tst_qheaderview.cpp
@@ -193,6 +193,7 @@ private slots:
void QTBUG6058_reset();
void QTBUG7833_sectionClicked();
void QTBUG8650_crashOnInsertSections();
+ void QTBUG12268_hiddenMovedSectionSorting();
protected:
QHeaderView *view;
@@ -2071,5 +2072,25 @@ void tst_QHeaderView::QTBUG8650_crashOnInsertSections()
model.insertColumn(0, items);
}
+void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting()
+{
+ QTableView view;
+ QStandardItemModel *model = new QStandardItemModel(4,3, &view);
+ for (int i = 0; i< model->rowCount(); ++i)
+ for (int j = 0; j< model->columnCount(); ++j)
+ model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j));
+ view.setModel(model);
+ view.horizontalHeader()->setMovable(true);
+ view.setSortingEnabled(true);
+ view.sortByColumn(1, Qt::AscendingOrder);
+ view.horizontalHeader()->moveSection(0,2);
+ view.setColumnHidden(1, true);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
+ QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton);
+ QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1);
+}
+
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"