QT 【样式表】

2022-07-29,

  • 设置样式
QApplication::setStyleSheet()
QWidget::setStyleSheet()
  • 样式
background 背景

1 样式表语法

1.1 样式规则
一个样式规则由 选择器和声明 构成. 
选择器 指定哪个widget受该规则影响.
声明   指定哪些熟悉被设置.
例:
	QPushButton {
    color: red }   // QPushButton 与 QPushButton 的子类的前景色为红色
	QPushButton, QLineEdit, QComboBox {
    color: red }  // 多个选择器由 逗号隔开
	QPushButton {
    color: red; background-color: white } //

本文地址:https://blog.csdn.net/u011310383/article/details/109250008

《QT 【样式表】.doc》

下载本文的Word格式文档,以方便收藏与打印。