【问题标题】:Color QPushButton plain white颜色 QPushButton 纯白色
【发布时间】:2021-04-01 16:37:31
【问题描述】:

我想给QPushButton 涂上纯白色,去掉 3D 阴影。 以下样式表:

  'background-color: rgb(255,255,255); \
   border-color: rgb(92,92,92);color: \
   rgb(92,92,92); \
   font: bold 22pt "Avenir"')

给我以下输出:

我想让按钮颜色统一为白色。

【问题讨论】:

  • 使用app.setStyle("fusion")
  • @eyllanesc 应用程序已经使用了app.setStyle(QtGui.QStyleFactory.create("Plastique")),我无法真正更改这一点,因为所有其他小部件看起来都很好。

标签: python pyqt4 qtstylesheets qpushbutton


【解决方案1】:

我需要设置的按钮属性是:

btn.setFlat(True)

这样,按钮是统一的白色。

【讨论】:

    猜你喜欢
    • 2016-06-17
    • 1970-01-01
    • 2017-05-26
    • 2017-08-20
    • 2014-01-07
    • 1970-01-01
    • 1970-01-01
    • 2019-04-06
    • 1970-01-01
    相关资源
    最近更新 更多