diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-10 13:30:01 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-10 13:30:56 (GMT) |
commit | e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f (patch) | |
tree | 829cdee2e9f94e28cbfc5c8f49b7c0b350b5ff8f /tests/auto/qtableview | |
parent | bc747a81f4f6f0978f71cd8d19f69060fc8a8041 (diff) | |
download | Qt-e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f.zip Qt-e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f.tar.gz Qt-e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f.tar.bz2 |
QTableView: horizontal scrollbar could be inoperent with big columns
Task-number: 240266
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r-- | tests/auto/qtableview/tst_qtableview.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index ae023ba..0a69b75 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -175,6 +175,7 @@ private slots: // task-specific tests: void task173773_updateVerticalHeader(); void task227953_setRootIndex(); + void task240266_veryBigColumn(); void mouseWheel_data(); void mouseWheel(); @@ -3127,6 +3128,31 @@ void tst_QTableView::task227953_setRootIndex() QVERIFY(!tableView.verticalHeader()->isHidden()); } +void tst_QTableView::task240266_veryBigColumn() +{ + QTableView table; + table.setFixedSize(500, 300); //just to make sure we have the 2 first columns visible + QStandardItemModel model(1, 3); + table.setModel(&model); + table.setColumnWidth(0, 100); //normal column + table.setColumnWidth(1, 100); //normal column + table.setColumnWidth(2, 9000); //very big column + table.show(); +#ifdef Q_WS_X11 + qt_x11_wait_for_window_manager(&view); +#endif + QTest::qWait(100); + + QScrollBar *scroll = table.horizontalScrollBar(); + QCOMPARE(scroll->minimum(), 0); + QCOMPARE(scroll->maximum(), model.columnCount() - 1); + QCOMPARE(scroll->singleStep(), 1); + + //1 is not always a very correct value for pageStep. Ideally this should be dynamic. + //Maybe something for Qt 5 ;-) + QCOMPARE(scroll->pageStep(), 1); + +} void tst_QTableView::mouseWheel_data() { |