【问题标题】:QCombobox transparent item list stylesheetQCombobox 透明项目列表样式表
【发布时间】:2014-11-06 13:23:51
【问题描述】:

我尝试从QComboBox 做列表我相信是QListView/QAbstractItemView 变得透明。就像在这个例子中一样,我想在列表下看到 Pushbutton。

我试着说:

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

喜欢无处不在。

【问题讨论】:

  • 这可能会有所帮助Remove QListView background
  • 不,它不起作用我试过了,但谢谢。很容易为自己获取示例来测试解决方案,只需在其下添加 QCombobox 及其下的内容和几个元素到组合框。
  • qtcentre.org/threads/… 你的视图是透明的,但其他的不是:QComboBoxPrivateContainer 我不知道如何解决这个问题。

标签: qt transparency qt5 qcombobox qtstylesheets


【解决方案1】:

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

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

希望这会有所帮助。

【讨论】:

  • 非常感谢!
猜你喜欢
  • 2015-07-08
  • 2012-01-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-05
  • 2022-10-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多