Comments (5)
I agree with you, but it's the default behavior of QComboBox in Qt, changing it is not just changing a property, we need to create custom combobox and override the scroll event, if it wasn't for that, it would have been done a long time ago. But it might be worth doing anyway, the behavior is annoying.
from strawberry.
Sure, let's see if I can help; I asked ChatGPT 4 to make an online search to see if anyone might have already addressed this, here's the answer:
Several approaches have been discussed and implemented by the Qt community to address the issue of disabling mouse wheel events on QComboBox widgets to prevent unintended value changes. Here are the summarized strategies from the forums:
-
Event Filter Method: You can install an event filter on the QComboBox. In the event filter, check if the event is a wheel event and simply return true to indicate that the event has been handled, effectively blocking it. This approach was detailed in the Qt Forum and Qt Centre discussions, demonstrating how to intercept and block wheel events specifically for combo boxes without requiring subclassing of the widget itself. This method involves overriding the
eventFilter
method in your class that contains the QComboBox and installing the event filter on the QComboBox instance. -
Custom Subclassing Method: Another method involves subclassing QComboBox and overriding the
wheelEvent
method. Within this method, you can include a condition to only call the base class's wheelEvent method if the combo box currently has focus. This ensures that wheel events will only affect the combo box when it is explicitly focused, avoiding unintended value changes when scrolling over it. This approach requires a bit more code but offers more control over the behavior of the combo box.
Both strategies are aimed at enhancing user experience by ensuring that combo box values cannot be changed unintentionally through scroll wheel actions, especially when the combo box is not the current focus of the application.
For implementing these solutions, the key is to intercept the wheel event and decide whether to propagate it to the QComboBox based on the widget's focus state. These solutions provide a way to customize the behavior of QComboBox in your application to match user expectations and standard UI practices more closely.
References:
- Qt Forum discussion on disabling mouse wheel scrolling on a ComboBox: forum.qt.io/topic/59191/combobox-disable-mouse-wheel-scrolling
- Qt Forum on ignoring mouse wheel events when ComboBox is not in focus: forum.qt.io/topic/25072/how-to-ignore-the-mouse-wheel-event-when-combo-box-is-not-in-focus
- Qt Centre discussion on disabling wheelEvent: www.qtcentre.org
These discussions and code examples should provide a solid foundation for addressing the issue in the Strawberry Music Player or any other application using Qt widgets.
from strawberry.
Is this what they mean when they say godspeed? ;) I'm eager to see the change in action! Thank you.
from strawberry.
You can try the latest from https://builds.strawberrymusicplayer.org/ubuntu/jammy/ if you want to test (Jammy should be compatible with Pop Os).
from strawberry.
I am currently using the flatpak version. Could you please push the update to that version too?
from strawberry.
Related Issues (20)
- Pressing Enter with a multi-section HOT 1
- MTP doesn't copy some files! HOT 4
- Flatpak Metadata updating HOT 2
- "Dynamic Random mix" sometimes goes on a loop of a few songs! HOT 1
- Please use this client id
- AddRadio Stations HOT 1
- Strawberry can open, play and edit metadata of m4b files, but are not listed in collection with other entries. HOT 3
- No valid frames decoded before end of stream ~ "GstFlacDec:flacdec21: no valid frames found" HOT 3
- Crashes when seeking in a module file (eg. XM, MOD, S3M) HOT 2
- "delete from disk" action does not delete file from disk [solved] HOT 5
- Songs skipping/rapidly playing(?) while Strawberry volume set to 0% HOT 6
- Pipewire Sink Poor Audio Quality HOT 2
- Shuffle order is always the same HOT 2
- Audio glitch after stopping playback if "Fade out when stopping a track" is enabled HOT 4
- [linux][delete file] [partition] should warn when trashing has failed (freedesktop spec)
- Delete from disk crashes Strawberry in Win10 HOT 5
- Scrobbler removes "(Remastered)" from song titles HOT 8
- Sidebar has ampersands "&" characters in text where it shouldn't HOT 1
- "make dmg" doesn't pick up tagreader binary HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strawberry.