How to get scroll bar real width in Qt?

后端 未结 2 1969
迷失自我
迷失自我 2021-01-12 13:48

I\'m trying to make a custom widget, which is basically a bunch of textedits with a single vertical scroll bar on the right. To keep widget size determined, I have to find a

相关标签:
2条回答
  • 2021-01-12 14:23

    I've also found

    vsb->sliderRect().width(); 
    

    which happens to be correct, but it looks bad in the code, as I have no interest in slider per se.

    0 讨论(0)
  • 2021-01-12 14:36
    int w = qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
    
    0 讨论(0)
提交回复
热议问题