I didnt look at QItemDelegate to see what can be overriden.
Thanks alot !
I still need to know the width of the vertical scrollbar.
I'll try to explain why.
I want QListWidget to display only 4 items at once (icons with text underneath)
(so the client rect is splitted in 4 equal parts).
For this i set IconMode view mode.
In order to display only 4 items I need to compute an item size and call QListWidgetItem::setHintSize( )
The item width cannot be just QListWidget::contentsRect().Width( ) / 2 because I need to take into account the left vertical scrollbar width also. Otherwise a horizontal scrollbar will appear.
that's why I need the width of the vertical scrollbar.
After I inserted items I tried to call
QRect rc = ui.listWidget->verticalScrollBar()->rect();
but it does not give consistent results.
I observed that the right size is computed after the first display.
is there a way to get scrollbar metrics \ force internal computation before actual painting ?
Bookmarks