PDA

View Full Version : How to deactivate horizontal scrolling in QScrollArea?



conti
15th October 2012, 11:23
Hi i got a problem with a QScrollArea. I want to deactivate horizontal scrolling. On windows systems i just use ->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ) this is sufficient for me. But on mac systems the user can scroll using the 2 finger scroll. How to block this?

wysota
15th October 2012, 11:45
Why do you want to deactivate scrolling?

conti
15th October 2012, 12:01
Because right now it is possible to scroll outside of the area wich contains the content (im override paintEvent to paint my own content). So i just want to stop the scrollbar in the scrollArea to change its value.

wysota
15th October 2012, 12:15
If it possible to scroll outside the area with the content, it is because you made it so. Did you subclass QAbstractScrollArea or QScrollArea?

conti
15th October 2012, 13:10
I subclassed QScrollArea.

wysota
15th October 2012, 13:14
And why not QAbstractScrollArea?