how to style the QScrollBar when the content is not scrolling?
-
13-07-2021 - |
题
I want to style the scrollbars. I am able to apply styles to scrollbar when scrollarea content is scrolling. But when the content is not scrolling the style is not getting applied to it.
I have used below style elements:
QScrollBar:vertical{ /** some styles **/ };
QScrollBar::handle:vertical{ /** some styles **/ };
QScrollBar::add-line:vertical{ /** some styles **/ };
QScrollBar::sub-line:vertical{ /** some styles **/ };
QScrollBar::add-page:vertical{ /** some styles **/ };
QScrollBar::sub-page:vertical{ /** some styles **/ };
These elements works fine when content is scrolling.
I tried to use below element when content is not scrolling:
QScrollBar:vertical:disabled{ /** some styles **/ };
But doesn't have any effect :(
Anyone has this similar issue please reply..
Thanks
解决方案
QScrollBar::handle:disabled{ /** some styles **/ }
不隶属于 StackOverflow