How to determine scrollbar width?
How can I find out how wide a scrollbar is at runtime?
I have a table that is sized to perfectly display the contents. Once there is enough items to show a scrollbar, it overlaps my content.
I would like to be able to query the scrollbar width, based on the current style, so that I can make my widget exactly wide enough to accommodate the scrollbar should it appear.
Thank!
Re: How to determine scrollbar width?
Hi!
How about:
Code:
qDebug
() << qApp
->style
()->pixelMetric
(QStyle::PM_ScrollBarExtent);
Happy coding!
Johannes
Re: How to determine scrollbar width?