titus
titus

Reputation: 5784

QScrollArea get scroll or total offset

Does QScrollArea have a way to find out how much it is scrolled? Do I need to do some accounting on all the scollContensBy() calls?
I need to get the position of the mouse relative to an image label inside QScrollArea. I can only get the position relative to the current view, not the whole image.

Upvotes: 5

Views: 4401

Answers (1)

jpm
jpm

Reputation: 3155

QAbstractScrollArea provides methods to access its scroll bars (horizontalScrollBar() and verticalScrollBar()). Once you have that pointer, you have access to all the methods and signals available from QScrollBar and QAbstractSlider, including value() and valueChanged().

Upvotes: 8

Related Questions