Conflict between QScroller and QScrollBar



  • I found a conflict between QScroller and QScrollBar. So I have a QScrollArea with vertical scrollbar. I also activate a QScroller that allows me to do kinetic scrolling with left click button. But I can't grab the scrollbar handle any more. Because once I grab it, QScroller begins to take over. This is how I add the QScroller:

    @QScroller::grabGesture(mArea, QScroller::LeftMouseButtonGesture) ; @

    Any idea how can I solve the conflict?



  • This is just a last resort, but you should be able to do QScoller::ungrabGesture() on the QScrollBar::mousePressEvent()

    Haven´t tested this though.



  • [quote author="hBovine" date="1400185916"]This is just a last resort, but you should be able to do QScoller::ungrabGesture() on the QScrollBar::mousePressEvent()

    Haven´t tested this though.[/quote]

    It's the right way to start.
    I redefined enterEvent and leaveEvent to dis dis-activate and re-ractivate QScrollers. Works fine. Thanks.



  • I would experiment with registering the QScroller not on the whole QScrollArea, but only on the client area. Or, try to use an event filter on the scrollbar.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.