Important: Please read the Qt Code of Conduct -

Kinetic scrolling via mouse wheel

  • Hey all,

    I have a subclassed QTableWidget with some rows and I would like to scroll though it smoothly. I have tried using QScroller which seems to be class of choice for this kind of problem but I wasn't able to achieve what I wanted.

    I was only able to get kinetic scrolling when clicking at a row and then moving the mouse up (like touching a list of the smartphone). What I would like to achieve is pretty much the same but with scrolling the mouse wheel instead.

    Is there a way to do this with the predefined class or do I need to implement this myself?

  • @jsmolka
    You don't say whether you are using desktop or mobile (assume desktop because of mousewheel?).

    Articles like:
    seem to suggest it should work with desktop mouse, or give hints for code.

    Just checking you've read them.

  • @JonB

    Yes. I am on PC and those articles don't really help. I want to scroll the mouse wheel and have a QScroller like effect. From what I've read QScroller only supports the left and right mouse button because it wants them to be pressed. I wasn't able to find something about the mouse wheel anywhere online.

  • @jsmolka
    This is way beyond my pay-grade, but at the end of the day if it's really the case that QScroller doesn't do what you want with mousewheel, can you not intercept those events and do your own QScrollBar::setValue() directly if there's no other way? I leave this possibitily with you.

Log in to reply