Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.9
-
None
-
Qt 5.15.9 Linux x86
Description
If I create a scroller using QScroller::grabGesture and add a series of items (QGraphicsWidgets in this case) to the scroller, it will scroll. However if I disable one of those items, that part of the scroller becomes unable to scroll. I did this using a scroller based off of the QScroller example: qtbase/examples/widgets/scroller/graphicsview/main.cpp
As one (not good) workaround I can call setAcceptedMouseButtons(Qt::NoButton) on the item - that allows it to scroll, but also causes mouse events to pass through even when disabled which is not expected behavior. (Imagine a disabled button - it should not pass events through to its parent widget when disabled, as it itself might be clickable.) The workaround causes issues if you want to have a button/clickable item on top of another button/clickable item and the top one gets disabled.
(1) I believe this is a bug (scrolling should work regardless of disabled state), but also
(2) Is there a better workaround for this behavior?