PDA

View Full Version : Scrollbar -- how to differentiate arrows from slider itself



macias
27th August 2007, 12:59
Hello,

I would like to know if the scrollbar position was changed by dragging slider or by pressing arrows (little widgets at the end of slider).

Background: I am using QTableWidget and I would like to two ways of scrolling, via dragging slider -> fine, precise scrolling line (pixel) by line, or via clicking on arrows to provide faster scrolling, by row.

have a nice day, bye

marcel
27th August 2007, 13:13
It is not possible to do that directly.
You could connect to the sliderPressed signal and set a flag in your class. Then, when you get the valueChanged signal you will now it was the result of a slider move. Otherwise the buttons were pressed.

You should take care with user keyboard actions, since they could emit the same signals( without sliderPressed).

Regards