Important: Please read the Qt Code of Conduct -

Mouse wheel and ScrollBar

  • I am using 'non-attached' ScrollBars (see the documentation to see what I mean by this) to provide scrolling to a component I am working on. It is not suitable to go in a ScrollView. It's essentially a text display component - like a cut down, readonly TextArea, intended to solve some performance issues I had with the latter when I had large amounts of text.

    The problem I have is that I can't get the mouse wheel to operate the vertical scrollbar. If I am in the scrollbar's bounding rectangle, it is activated by hover and the usual left mouse button stuff works OK but the wheel does not. I have tried setting wheelEnabled (inherited from Control) but it makes no difference.

    (Note that I can make wheel scrolling work in the main text area by means of a MouseArea but whether or not I have this I can't get the scrollbar to respond to the mouse wheel.)

    I'd be grateful for any ideas how on how to get mouse wheel working with ScrollBar.

Log in to reply