PDA

View Full Version : ScrollBar position for QScrollArea



Dendy
4th November 2009, 16:53
Can somebody tell me how to move scroll bars for the QScrollArea? I want vertical scroll bar to be attached to the left, not right.

Lykurg
4th November 2009, 17:37
QAbstractScrollArea::verticalScrollBar() and QAbstractSlider::setValue()?

Dendy
4th November 2009, 18:14
QAbstractScrollArea::verticalScrollBar() and QAbstractSlider::setValue()?

Scroll area layout managed internally, looks like I need to read sources to understand how to replace default behavior. Just want to know if anybody did the same.

Lykurg
4th November 2009, 18:43
Scroll area layout managed internally, looks like I need to read sources to understand how to replace default behavior. Just want to know if anybody did the same.
Ah, I have misunderstood your first post. Isn't the position of the scroolbars changed if you set the layout direction from right to left? Nor sure...

Dendy
5th November 2009, 13:55
This could be a trick, will try now and tell is it works.

Dendy
5th November 2009, 14:06
Unfortunately, Qt says: "Children added after the call to setLayoutDirection() will not inherit the parent's layout direction." This means we can do nothing with QAbstractScrollArea after instance has been created. Will read source more to understand better.

Animator1
28th March 2011, 10:17
Did anyone solve this problem?

wysota
28th March 2011, 11:34
Reimplement resizeEvent() for the scroll area and position the scrollbars manually. Also use QAbstractScrollArea::setViewportMargins() to set the margin on the left side instead of the right size of the viewport.