qt6-bb10/tests/auto/widgets
Sophie Kums aa09bea00c control scrolling of QTabBar using StyleHint
Mouse wheel/touchpad scroll signals sent to the tab bar trigger
cycling through the tabs. In applications where the tab bar is
close to "mouse click hotspots", the cursor may accidentally be
left over the tab bar instead of the main content of the window.
When the user wants to scroll up/down the main conten, the
scroll signals are thus sent to the tab bar and instead of
scrolling, the focus switches to another tab. This is
confusing to the user, because not only does the application
not carry out the desired action (scrolling through the main
content), it jumps to a different tab. Two common examples of
applications affected by this nuisance are Konsole and any kind
of browser (file browser or web browser), where the address bar
is right below the tab bar. Moreover, on macOS, scroll events
do not have an effect on the tab bar widget of the native UI.
Currently, the code makes use of preprocessor directives to
achieve consistent behavior on macOS (`#ifndef Q_OS_MAC`). This
patch implements the check of a StyleHint in order to determine
if scroll events on the tabbar should have an effect. This
approach is more consistent with Qt coding style than
OS-dependent preprocessor directives and, in addition, makes
the behavior configurable according to the user's preferences.

[ChangeLog][QtWidgets][QStyle] Added
SH_TabBar_AllowWheelScrolling as a style hint to enable/disable
cycling through tabs using the scroll wheel. This defaults to
true in all styles except the macOS one so there is no change in
existing behavior.

Change-Id: I99eeb5a1aab03cbc574fac7187d85a8a2d60cf34
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-01-19 19:10:41 +01:00
..
dialogs Windows: Fix dialog moving up after closing/reshowing 2021-01-15 18:05:19 +01:00
effects Remove the qmake project files 2021-01-07 15:32:28 +01:00
graphicsview Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
itemviews Remove the qmake project files 2021-01-07 15:32:28 +01:00
kernel Fix setting active window as application's focus widget 2021-01-15 15:22:18 +01:00
styles Set the PlaceholderText color in the palette from the stylesheet as well 2021-01-12 20:24:28 +01:00
util Remove the qmake project files 2021-01-07 15:32:28 +01:00
widgets control scrolling of QTabBar using StyleHint 2021-01-19 19:10:41 +01:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00