[PyQt] PyQt ScrollArea - Scroll Wheel/two-fingure-scroll-gesture - Doesn't work unless mouse is over the scrollbar

Saravanan Shanmugham sarvi at yahoo.com
Thu Aug 8 22:43:48 BST 2013


I have a working PyQt GUI that has a scroll area with some matplotlib plots. As expected I see a scrollbar on the right side and the bottom of the scroll area.
I am using a MAC When I move my mouse over the Scroll Bar and then I use the two-finger pan gesture i.e mouse wheel, I see mouse wheel events show up in my widget event handler. But for this to happen I have to have my mouse hovering over the scrollbar itself. It doesn't work if I do it with my mouse inside the scroll area.
I would like to be able control the scroll area(pan left/right/up/down) with the 2 finger PanGesture and scroll up/down left/right when my mouse is inside the Scroll Area.
I have tried listening to gesture events, with a self.grabGesture(QtCore.Qt.PanGesture) API but I don't see any gesture events only Touch events.
My real goal is not necessary touch gestures. just a simple way to scroll the scrolls area using the keys and mouse/mouse-wheel-OR-gesture-in-case-of-MAC-touchpad without having to go to the scrollbar on the left or bottom. 
How can I achieve this in PyQt?
Thx,
Sarvi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20130808/af770fa1/attachment.html>


More information about the PyQt mailing list