Python PyQt隐藏QToolbutton菜单

2024-09-27 00:14:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我想隐藏出现在QToolButton上的Small Down Arrow,如果我给它设置了QMenu。在

我尝试过使用StyleSheet,方法是将QToolButtonmenu-arrowimage设置为none。以下是我的Qss代码:

QToolButton
{
    border:1px solid #B6C4DB;
      border-radius:12px;
      padding:2px;
      margin-left:5px;
}

QToolButton::menu-arrow
{
    image:none;
} 

QToolButton:pressed 
{
         border:1px solid #D6BB0B;
}

有没有办法用菜单隐藏QToolButton上的小箭头?在


Tags: 方法代码nonesmalldownsolidborderarrow

热门问题