Qt组合框样式表在max osX上

Qt combobox stylesheets on max osX

本文关键字:max osX 组合 样式 Qt      更新时间:2023-10-16

我尝试了许多不同的选项来设计QCombobox的样式,但我在mac osx上仍然有一些问题。它看起来像这样:在osx上http://img90.imageshack.us/img90/9550/stylesheets.png

我想删除视图列表顶部/底部的白色,但是我似乎找不到这样做的方法。

下面是我现在的代码:
QComboBox{
    color:rgba(200,200,200,255);
    background-color:rgba(71,71,71,255);
    selection-color:rgba(243,149,0,255);
    selection-background-color:rgba(71,71,71,255);
}
QComboBox QAbstractItemView{
    border-radius:0px;
    border:0px;
    selection-background-color:rgba(71,71,71,255);
    background:rgba(71,71,71,255);
    color:rgb(200,200,200);
}

感谢您的帮助

谢谢

使用自己的应用程序样式(基于QProxyStyle) &重写QProxyStyle::styleHint为:

<>之前int CMyProxyStyle::styleHint(styleHint提示,const QStyleOption*选项= 0,const QWidget* widget = 0, QStyleHintReturn* returnData =0) const{if(SH_ComboBox_Popup ==提示)//禁用组合框弹出的顶部和底部区域返回QProxyStyle::styleHint(提示,选项,部件,returnData);}之前

为qApp实例安装自己的样式:

<>之前qApp->setStyle(new CMyProxyStyle);