Skip to content

fix: Disable preset combo scroll #432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025

Conversation

gselzer
Copy link
Contributor

@gselzer gselzer commented May 13, 2025

Yesterday in the lab we accidentally ran into #372, which motivated me to fix the bug. I did see #307, however apparently that PR does not fix the problem.

This PR overrides the wheelEvent method to ignore QWheelEvents on preset combo boxes, and adds a test ensuring as such.

@gselzer gselzer requested a review from tlambert03 May 13, 2025 20:59
Copy link

codecov bot commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.54%. Comparing base (c4b863d) to head (ef452a4).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #432   +/-   ##
=======================================
  Coverage   90.53%   90.54%           
=======================================
  Files          90       90           
  Lines        9850     9853    +3     
=======================================
+ Hits         8918     8921    +3     
  Misses        932      932           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tlambert03
Copy link
Member

oh awesome. please try to fix sliders too! :) i swear to god i've tried to fix it so many times and failed. i don't know why I struggled so much 😂 anyway thanks for this. will take a final look later today

@tlambert03
Copy link
Member

ok, this is probably better than nothing, but what I really wanted in #372 was for the mouse event to pass up to the scroll area. with this approach, if you are scrolling and hit a combobox, then scrolling just stops (though, thankfully, no values are changed). Also, it still leaves things like sliders changing, so doesn't quite close #372.

I think we might have more global luck (and finer tuned control) by installing an event filter on the parent widget: https://doc.qt.io/qt-6/eventsandfilters.html#event-filters ... it should be able to intercept all events and decide whether or not to pass them down. (though, i feel like I've struggled in the past to get it to work). let me try something quickly

@tlambert03
Copy link
Member

tlambert03 commented May 13, 2025

k, i'm gonna merge this as an improvement, but i removed the closes flag, sinceI consider that issue to still be unsolved while sliders are still sliding

edit: ah also: based on what you edited here, it looks like you're trying to solve it for the groups and presets widget ... but #372 was about the property browser

@tlambert03 tlambert03 merged commit 967fa6a into pymmcore-plus:main May 13, 2025
23 checks passed
@tlambert03 tlambert03 added the bug Something isn't working label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants