/* 整个垂直滚动条区域样式 */ QScrollBar:vertical { border: none; background: rgb(30, 30, 30); width: 10px; margin: 0px 0 0px 0; } /* 整个水平滚动条区域样式 */ QScrollBar:horizontal { border: none; background: rgb(30, 30, 30); height: 10px; margin: 0px 0 0px 0; } /* 滑块区域样式 */ QScrollBar::handle:vertical { background: rgb(66, 66, 66); min-height: 20px; border-radius: 5px; border: none; /* margin: 0 1px 0 1px; */ } QScrollBar::handle:horizontal { background: rgb(66, 66, 66); min-height: 20px; border-radius: 5px; border: none; } /* 鼠标滑过滑块样式 */ QScrollBar::handle:vertical:hover, QScrollBar::handle:vertical:pressed { background: rgb(79, 79, 79); /* margin: 0 0 0 0; */ } QScrollBar::handle:horizontal:hover, QScrollBar::handle:horizontal:pressed { background: rgb(79, 79, 79); } /* 向下箭头样式 */ QScrollBar::add-line:vertical { border: none; background: none; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; } /* 向右箭头样式 */ QScrollBar::add-line:horizontal { border: none; background: none; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; } /* 向上箭头样式 */ QScrollBar::sub-line:vertical { border: none; background: none; height: 0px; subcontrol-position: top; subcontrol-origin: margin; } /* 向左箭头样式 */ QScrollBar::sub-line:horizontal { border: none; background: none; height: 0px; subcontrol-position: top; subcontrol-origin: margin; } /* 滚动条上面和下面区域样式 */ QScrollBar::sub-page:vertical, QScrollBar::add-page:vertical { background: none; width: 0px; height: 0px; } /* 滚动条左面和右面区域样式 */ QScrollBar::sub-page:horizontal, QScrollBar::add-page:horizontal { background: none; width: 0px; height: 0px; }
标签:none,qt,样式,height,滚动条,QScrollBar,background,0px,border From: https://www.cnblogs.com/RedWetPlace/p/17909528.html