gpt4 book ai didi

qt - 隐藏 QScrollBar 箭头

转载 作者:行者123 更新时间:2023-12-04 00:44:30 29 4
gpt4 key购买 nike

如何隐藏 QScrollBar 箭头?

我需要隐藏在水平滚动条中。
我试图用 setStyleSheet 隐藏:

setStyleSheet(" QScrollBar:left-arrow:horizontal, QScrollBar::right-arrow:horizontal { height:0px; }" )

但它不起作用。

最佳答案

如果您只需要隐藏按钮内的箭头,那么您可以尝试以这种方式设置背景和边框:

QScrollBar::right-arrow:horizontal, QScrollBar::left-arrow:horizontal
{
border: none;
background: none;
color: none;
}

如果你想隐藏整个按钮,那么你可以使用下面的代码。
QScrollBar::add-line:horizontal {
border: none;
background: none;
}

QScrollBar::sub-line:horizontal {
border: none;
background: none;
}

关于qt - 隐藏 QScrollBar 箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21157195/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com