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

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);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置