How to modify the vertical scrollbar hander max-height?
-
I tried the qstylesheet method to change the vertical scrollbar handler max-height but failed.
For example,set the scrollbar's handler an absolute height no matter if the scrollbar has been maximumed or minimumed . -
@nicker-player
Add this min-height & max-height in stylesheet . Examples :QScrollBar::handle:vertical
{
background-color: rgb(200, 200, 200);
min-height: 100px;
max-height: 200px;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 4px;
} -
@anil_arise
In fact,i did what u just mentioned but didnot work.
The max height for the vertical hander seemed unuseful. the scroll hander height has nothing to be changed. -
hi
The QScrollbar handle size is dynamically changed depending on its min and max values so I'm not sure
we can change it with a stylesheet.Would it be possible to use a QSlider instead ?
-
@nicker-player Maybe you can try
auto scrollArea = new QScrollArea( this )
auto contents_widget = new QWidget;
contents_widget->setFixedSize(....);
scrollArea->setWidget( contents_widget );layout other widgets with contents_widget. Then scrollArea size will not change.
-
@mrjj
In fact,I think that its unuseful for using the qslider.Cause that in the qtablewidget,there is a scroll bar.@JoeCFD
How to modified the code to the tablewidget?
I tried to set the fixedheight of the tablewidget,the tablewidget height did not change whether if the dialog widget maximum or minimum,and the scrollbar handle height changed to the max height as long as the scroll bar.