diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-29 11:03:34 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-29 11:50:52 (GMT) |
commit | 316bf04887aed61804e16d64857754b78cf2f713 (patch) | |
tree | 42adc2189672e8b0763bf8a8c57841885d91b8d2 /tests/auto/qtableview | |
parent | 0f1aeb863474d2894a896fb28ea8eae8d736a363 (diff) | |
download | Qt-316bf04887aed61804e16d64857754b78cf2f713.zip Qt-316bf04887aed61804e16d64857754b78cf2f713.tar.gz Qt-316bf04887aed61804e16d64857754b78cf2f713.tar.bz2 |
ItemViews: make the geometries update when header data changes
autotest included
Task-number: QT-711
Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r-- | tests/auto/qtableview/tst_qtableview.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index fe2794f..227ca6f 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -203,6 +203,8 @@ private slots: void addColumnWhileEditing(); void task234926_setHeaderSorting(); + + void changeHeaderData(); }; // Testing get/set functions @@ -3883,5 +3885,24 @@ void tst_QTableView::taskQTBUG_5062_spansInconsistency() VERIFY_SPANS_CONSISTENCY(&view); } +void tst_QTableView::changeHeaderData() +{ + QTableView view; + QStandardItemModel model(5,5); + view.setModel(&model); + view.show(); + QTest::qWaitForWindowShown(&view); + + QString text = "long long long text"; + const int textWidth = view.fontMetrics().width(text); + QVERIFY(view.verticalHeader()->width() < textWidth); + + model.setHeaderData(2, Qt::Vertical, text); + QTest::qWait(100); //leave time for layout + + QVERIFY(view.verticalHeader()->width() > textWidth); +} + + QTEST_MAIN(tst_QTableView) #include "tst_qtableview.moc" |