From 934f06220391eb0e0ebf66a2eb037f48adb4c43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Wed, 7 Nov 2012 19:06:01 +0100 Subject: QAIV - Fix scollbars with ScrollPerPixel to scroll 1 pixel. The documentation says that we scroll one pixel Quote: "QAbstractItemView::ScrollPerPixel (value 1)" "The view will scroll the contents one pixel at a time." However until now Qt has tried to be smarter than the documentation, but is actually getting in the way of the user, where a manual set value to setSingleStep will continuingly be overwritten (on e.g resize). This patch ensures the behavior described in the documentation for the vertical headers - and leaves the control to the user. [ChangeLog][QtWidgets][QAbstractItemView] QTBUG-7232 - In ItemViews scrollbars will now by default only scroll 1 pixel when scrollMode is set to scrollPerPixel. That is it will (when scrollMode is scrollPerPixel) do what is stated in the documentation, and no longer automatically adjust the scrollbars singleStep. The user can now control that value. Task-number: QTBUG-7232 Change-Id: I8a61d3100be65d0c4ee32aad58caed019aa2669c Reviewed-by: Stephen Kelly --- tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/widgets/itemviews') diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index dfb780c8fa..76ac6bcf19 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -3702,7 +3702,7 @@ void tst_QTableView::mouseWheel_data() << 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines(); QTest::newRow("scroll down per pixel") << int(QAbstractItemView::ScrollPerPixel) << -120 - << 10 + qApp->wheelScrollLines() * 89 << 10 + qApp->wheelScrollLines() * 28; + << 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines(); } void tst_QTableView::mouseWheel() -- cgit v1.2.3