你的代码中出现了拼写错误,heigtht
应该是height
。请修正如下:
QScrollBar:vertical {
background-color: rgba(54, 54, 54, 0);
width: 20px;
height: 20px; /* 正确设置高度 */
border: 1px solid;
border-color: rgb(255, 255, 255);
margin: 0px,0px,0px,0px;
}
QScrollBar::handle:vertical {
width: 16px;
height: 20px; /* 正确设置高度 */
max-width: 40px;
border: 1px solid rgb(255, 0, 255);
}
请注意,在样式表中,通过正确的属性名height
来设置垂直滚动条的高度。一旦更正这个拼写错误,你的样式应该可以正确地设置垂直滚动条的高度。
内容由零声教学AI助手提供,问题来源于学员提问