qss使用详解

  • qss的作用
  • 怎么使用qss
  • qss语法详解
    • 单个设置
      • QPushButton { color: red }
    • 多个一起设置
      • QPushButton, QLineEdit, QComboBox { color: red }
    • 设置所有控件
      • *  { color: red }
    • 根据属性
      • QPushButton[flat=”false”] { color: red }
    • 不包括子类的设置
      • .QPushButton { color: red }
    • 指定实例
      • QPushButton#okButton { color: red }
    • 包含关系的设定,包含子类
      • QDialog QPushButton { color: red }
        • 设置QDialog 中的所有QPushButton
    • 包含关系,不包含子类
      • QDialog > QPushButton { color: red }
    • 子控件
      • QComboBox::drop-down { image: url(dropdown.png) }
    • 根据状态
      • QComboBox::down-arrow:pressed  {...}
      • QPushButton:hover {...}
      • QRadioButton:!hover { color: red }
      • QPushButton:hover:!pressed { color: blue; }
    • 指定命名控件
      • ns--MyPushButton { background: yellow; }
  • 关于作用域
    • 包含关系:控件里的其他控件不会自动继承qss
    • 继承关系:子类继承父类的qss设置
  • 优先级
    • 父类设置=子类<指定objname的控件
    • 父类和子类哪个起效果看以最后一个出现的设置为准




转载于:https://www.cnblogs.com/dongdongweiwu/p/4743695.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值