listwidget Scrollbar isvisble
-
If you insert more than a few items into the list widget, the scrollbar appears.
this->ui.listWidget->verticalScrollBar()->isVisible();It seemed to tell us how it was after it appeared.
I want to know the status of the scrollbar before it appears in the view, is there any way?
-
If you insert more than a few items into the list widget, the scrollbar appears.
this->ui.listWidget->verticalScrollBar()->isVisible();It seemed to tell us how it was after it appeared.
I want to know the status of the scrollbar before it appears in the view, is there any way?
-
@IknowQT Not sure what you mean.
isVisible() tells you whether the scroll bar is visible or not. -
When I put more than 10 items in my list widget, the scrollbar appears, and every time I insert an item, I check isvisible() and false in the 10th, false in the 11th, and then scrollbar appears in the view, and then the invisible status is true.
@IknowQT Still not sure I understand you correctly (it is hard to understand your descriptions) - isn't that exactly what should happen? The scroll bar appears then >10 entries are added. As long as you have <=10 entries it is not shown, so isVisible() returns false, which is correct. If you add more than 10 items the scroll bar is shown and isVisible() returns true.
If my understanding is wrong then please try to explain better.