...by knowing how many item one wants to show and how much space eachJust check if the scrollbar should be visible at all.
of them will use up and how much space there is available, I presume.
Qt doesn't seem to know [whether a scrollbar is needed] by the time sizeHint is called;
The scrollbar width() always returns 100 there, it changes into 16 once it is actually rendered on screen.
Bookmarks