Search code examples
qtscrollbarqscrollarea

How to find out the amount scrolled in a QScrollArea


I have a QScrollArea which contains a QWidget. The scroll area only allows to scroll vertically. How can I find out by how many pixels the QWidget is scrolled? I found scrollContentsBy() in the documentation but not the equivalent getter. Any help would be appreciated.


Solution

  • Use MyScrollArea -> verticalScrollBar() -> value().