summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qtreeview
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2016-02-05 16:41:20 -0800
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2016-02-11 04:50:36 +0000
commit9e8c84aa14ee26c04ab04ff28f0bab22e04887d6 (patch)
tree5136a2afb0bdcdfa5e0e27adebe5c02f4fa3d411 /tests/auto/widgets/itemviews/qtreeview
parentcc2938b5b6aa07210b04bd48ad8a2830701a06e5 (diff)
Add SH_ItemView_ScrollMode style hint and use it in QMacStyle
On OS X, the default scrolling mode of item views should be per pixel instead of per item. We enforce this through a new style hint. On all other platforms, the behavior remains the same. It's still possible to override the style hint by using the regular scroll mode setters. Any subsequent style change will result in a no-op once the setters have been called and until the properties are reset. Some auto-tests had to be update to to take the new behavior into account. [ChangeLog][QtWidgets][Styles] Added SH_ItemView_ScrollMode style hint. [ChangeLog][QtWidgets][Item Views] Item views scroll per pixel on OS X now. [ChangeLog][QtWidgets][Item Views] QAbstractItemView::verticalScrollMode and QAbstractItemView::horizontalScrollMode are now resettable. Change-Id: I3f923275c99aa4389323b52fc1c5455fe71f8d73 Task-number: QTBUG-50102 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/itemviews/qtreeview')
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index e21aedee1e..137f18e23a 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -503,7 +503,7 @@ void tst_QTreeView::construction()
QCOMPARE(view.sizeHintForRow(1), -1);
QVERIFY(!view.tabKeyNavigation());
QCOMPARE(view.textElideMode(), Qt::ElideRight);
- QCOMPARE(view.verticalScrollMode(), QAbstractItemView::ScrollPerItem);
+ QCOMPARE(static_cast<int>(view.verticalScrollMode()), view.style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, &view));
QCOMPARE(view.visualRect(QModelIndex()), QRect());
// QTreeView properties