diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2016-02-05 16:41:20 -0800 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2016-02-11 04:50:36 +0000 |
commit | 9e8c84aa14ee26c04ab04ff28f0bab22e04887d6 (patch) | |
tree | 5136a2afb0bdcdfa5e0e27adebe5c02f4fa3d411 /src/widgets/styles/qstyle.cpp | |
parent | cc2938b5b6aa07210b04bd48ad8a2830701a06e5 (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 'src/widgets/styles/qstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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() */ |