Hello!
I need to move the position of the horizontal scroll bar of a QScrollArea at the top of the widget. Is there anyone who know how to do this?
Thanks,
py
Hello!
I need to move the position of the horizontal scroll bar of a QScrollArea at the top of the widget. Is there anyone who know how to do this?
Thanks,
py
Yes, it's quite simple. You need to subclass the widget, set viewport margins (using QAbstractScrollArea::setViewportMargins)so that the margin is in the top and not in the bottom of the viewport and reimplement resizeEvent() where you will have to reposition the horizontal scrollbar after every resize of the widget. Be aware of the fact that hiding and showing the scroll bar will probably require a bit more work to keep the viewport margins coherent.
Thanks wysota,
I'll try that this week and I will let you know the outcomes..
py
Bookmarks