QCombobox透明项目列表样式表

时间:2014-11-06 13:23:51

标签: qt transparency qt5 qcombobox qtstylesheets

我尝试从QComboBox开始列表我认为QListView/QAbstractItemView变得透明。就像在这个例子中一样,我想在列表中看到Pushbutton。

enter image description here

我试着说:

background: transparent background-color: transparent border-style: transparent border-color: transparent

喜欢到处都是。

1 个答案:

答案 0 :(得分:3)

所以,我问qt支持并且答案是在样式表中这样做并不容易,并且建议的方法是更改​​弹出窗口的不透明度属性,其中绘制了组合框列表:

if (combo->view()->parentWidget())
    combo->view()->parentWidget()->setWindowOpacity(0.5);

希望这会有所帮助。

相关问题