From 9e8c84aa14ee26c04ab04ff28f0bab22e04887d6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 5 Feb 2016 16:41:20 -0800 Subject: 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 --- src/widgets/styles/qstyle.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/widgets/styles/qstyle.cpp') diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 34d5b49ee1..26bb227e29 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1978,6 +1978,10 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, tab is changed while dragging over the tabbar, in milliseconds. This enum value has been introduced in Qt 5.4 + \value SH_ItemView_ScrollMode The default vertical and horizontal scroll mode as specified + by the style. Can be overridden with QAbstractItemView::setVerticalScrollMode() and + QAbstractItemView::setHorizontalScrollMode(). This enum value has been introduced in Qt 5.7. + \sa styleHint() */ -- cgit v1.2.3