Skip to content

Conversation

@Servall4
Copy link

Remove custom wheelEvent handler. Default QAbstractScrollArea wheel handler seems to work better on platforms like MacOS.

Before:

ads_impl-Untitled.MPEG-4.mp4

due to hardcoded step value, it is very difficult to scroll to the desired tab

After:

qt_impl-Untitled.MPEG-4.mp4

@githubuser0xFFFF
Copy link
Owner

Thank you for your pull request. If I merge the request,, then scrolling the tabs via mouse wheel does not work anymore on Windows with Qt 6.5.2.

@githubuser0xFFFF
Copy link
Owner

I just pushed a branch improved_tabbar_scroll with improved wheelEvent function. Please test, if this improves scrolling on Mac for you.

@Servall4
Copy link
Author

Servall4 commented Dec 5, 2024

Yes, scrolling has become much smoother on the touchpad, but it now works on the Y axis, which is unusual for a touchpad.

@Servall4
Copy link
Author

Servall4 commented Dec 5, 2024

Apparently, the Qt implementation does not assume scrolling of the horizontal scrollbar along the Y axis, this is why scrolling didn't work for you. So we can cheat and send this wheelEvent directly to horizontal scrollbar with this code in CDockAreaTabBar::wheelEvent():
QCoreApplication::sendEvent(horizontalScrollBar(), Event);
Similar logic is implemented in the Qt source code.
Can you test updated code, please?

@githubuser0xFFFF
Copy link
Owner

The code works now. I will merge your pull request. Thank you.

@githubuser0xFFFF githubuser0xFFFF merged commit 1f21eb0 into githubuser0xFFFF:master Dec 12, 2024
1 check passed
mike-malburg pushed a commit to TechSmith/Qt-Advanced-Docking-System that referenced this pull request Nov 6, 2025
* Improved tab bar scrolling

* Fix: tab bar scroll for mouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants