how to style the QScrollBar when the content is not scrolling?

人走茶凉 提交于 2020-12-12 04:59:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!