qq_38180694 2017-11-23 06:20 采纳率: 0%
浏览 3288

linux 下Qt QComboBox设置他的列表透明样式

图片说明
我用ui->comboBox->view()->parentWidget()->setWindowOpacity(0.6);去设置,但是如果我再加载Qss,就不行了,Qss中我也没有设置过列表的样式,图片说明

  • 写回答

1条回答 默认 最新

  • 一去丶二三里 C++ 领域优质创作者 2017-11-24 07:16
    关注

    样式语法请参考:

     QComboBox {
            height: 25px;
            border-radius: 4px;
            border: 1px solid rgb(100, 100, 100);
            background: rgb(72, 72, 73);
    }
    QComboBox:enabled {
            color: rgb(175, 175, 175);
    }
    QComboBox:!enabled {
            color: rgb(155, 155, 155);
    }
    QComboBox:enabled:hover, QComboBox:enabled:focus {
            color: rgb(230, 230, 230);
            background: rgb(68, 69, 73);
    }
    QComboBox::drop-down {
            width: 20px;
            border: none;
            background: transparent;
    }
    QComboBox::drop-down:hover {
            background: rgba(255, 255, 255, 30);
    }
    QComboBox::down-arrow {
            image: url(:/Black/arrowBottom);
    }
    QComboBox::down-arrow:on {
            /**top: 1px;**/
    }
    QComboBox QAbstractItemView {
            border: 1px solid rgb(100, 100, 100);
            background: rgb(68, 69, 73);
            outline: none;
    }
    QComboBox QAbstractItemView::item {
            height: 25px;
            color: rgb(175, 175, 175);
    }
    QComboBox QAbstractItemView::item:selected {
            background: rgba(255, 255, 255, 40);
            color: rgb(230, 230, 230);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥20 蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏