坑1 text-align仅支持QPushButton and QProgressBar
The alignment of text and icon within the contents of the widget.
If this value is not specified, it defaults to the value that depends on the native style.
Example:
QPushButton {
text-align: left;
}
This property is currently supported only by QPushButton and QProgressBar.
解决:
margin:0 auto; 代替。
坑2 Line 属于QFrame 样式表这样写
#line1 {
border:1px solid rgb(255,0,0);
}