隐藏QScrollBar箭头 [英] Hide QScrollBar arrows

查看:1706
本文介绍了隐藏QScrollBar箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何隐藏QScrollBar箭头?

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

I need to hide in horizontal scrollbar. I was trying to hide with setStyleSheet:

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

但是它不起作用.

推荐答案

如果您只需要隐藏按钮内的箭头,则可以尝试通过以下方式设置背景和边框:

If you need to hide just the arrows inside buttons then you can try to set background and border in this way:

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

如果您想隐藏整个按钮,请使用下面的代码.

If you want to hide whole buttons then you go with code below.

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

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

这篇关于隐藏QScrollBar箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆