问题
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
回答1:
QScrollBar::handle:disabled{ /** some styles **/ }
来源:https://stackoverflow.com/questions/13029813/how-to-style-the-qscrollbar-when-the-content-is-not-scrolling