191 void task236450_hidden(); |
191 void task236450_hidden(); |
192 void task248050_hideRow(); |
192 void task248050_hideRow(); |
193 void QTBUG6058_reset(); |
193 void QTBUG6058_reset(); |
194 void QTBUG7833_sectionClicked(); |
194 void QTBUG7833_sectionClicked(); |
195 void QTBUG8650_crashOnInsertSections(); |
195 void QTBUG8650_crashOnInsertSections(); |
|
196 void QTBUG12268_hiddenMovedSectionSorting(); |
196 |
197 |
197 protected: |
198 protected: |
198 QHeaderView *view; |
199 QHeaderView *view; |
199 QStandardItemModel *model; |
200 QStandardItemModel *model; |
200 }; |
201 }; |
2069 QList<QStandardItem *> items; |
2070 QList<QStandardItem *> items; |
2070 items << new QStandardItem("c"); |
2071 items << new QStandardItem("c"); |
2071 model.insertColumn(0, items); |
2072 model.insertColumn(0, items); |
2072 } |
2073 } |
2073 |
2074 |
|
2075 void tst_QHeaderView::QTBUG12268_hiddenMovedSectionSorting() |
|
2076 { |
|
2077 QTableView view; |
|
2078 QStandardItemModel *model = new QStandardItemModel(4,3, &view); |
|
2079 for (int i = 0; i< model->rowCount(); ++i) |
|
2080 for (int j = 0; j< model->columnCount(); ++j) |
|
2081 model->setData(model->index(i,j), QString("item [%1,%2]").arg(i).arg(j)); |
|
2082 view.setModel(model); |
|
2083 view.horizontalHeader()->setMovable(true); |
|
2084 view.setSortingEnabled(true); |
|
2085 view.sortByColumn(1, Qt::AscendingOrder); |
|
2086 view.horizontalHeader()->moveSection(0,2); |
|
2087 view.setColumnHidden(1, true); |
|
2088 view.show(); |
|
2089 QTest::qWaitForWindowShown(&view); |
|
2090 QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1); |
|
2091 QTest::mouseClick(view.horizontalHeader()->viewport(), Qt::LeftButton); |
|
2092 QCOMPARE(view.horizontalHeader()->hiddenSectionCount(), 1); |
|
2093 } |
|
2094 |
2074 QTEST_MAIN(tst_QHeaderView) |
2095 QTEST_MAIN(tst_QHeaderView) |
2075 #include "tst_qheaderview.moc" |
2096 #include "tst_qheaderview.moc" |