The idea is easy, simply compensate the empty space on each item to use the whole space on the width but to remove this constant, it's not so easy.
Using a little value to only have very little empty space you got bad result (flickering). The solution I give is the only one I found after lot of tests.
Maybe a padding-left needed to solve completely, but then you have big margin on the left and right of the row.
using :
m_ListWidget->setStyleSheet( "QListView{ padding-left: 10px; }" );
m_ListWidget->setStyleSheet( "QListView{ padding-left: 10px; }" );
To copy to clipboard, switch view to plain text mode
I have to use this value to have 0 flickering (if the scrollbar is visible or not) :
const int RightMargin = 28;
const int RightMargin = 28;
To copy to clipboard, switch view to plain text mode
But the margin is not the same on the left and right, I have 10px on the left but more space on the right, 28px.
For the case where no padding-left is set, I got also good visual without flickering using 18px for the RightMargin, which gives less empty space than 20px.
That works very well but it's not centered, you have 0 empty space on the left and 18px empty space on the right and no solution found to have it centered...
Bookmarks