سؤال

I have a QScrollArea with a set of custom sliders arranged on it. I have noticed that when trying to scroll through the scroll area, one of the sliders often ends up moving instead, which is not desirable.

To make the custom sliders ignore the scroll wheel, I think I need to override QAbstractSlider::wheelEvent and just call ignore in there. This might be a silly question, but is there a way to get this behavior without deriving yet another slider-related class?

هل كانت مفيدة؟

المحلول

You may install an event filter on each of the sliders. When your filter receives a wheel event, just return true to filter this event out.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top