Qt版本:5.9.1
-----
0.如何设置所有按钮全局统一样式,如soui那样的?
如取消所有按钮默认样式
[
//全局设置,取消按钮默认样式
this->setStyleSheet("QPushButton \
{\
border: none;\
background-color: transparent;\
outline: none;\
}");
]
该设置对该窗口上所有PushButton都会生效
具体:
整体程序:qApp->setStyleSheet("QLineEdit { background-color: yellow }");
对话框:myDialog->setStyleSheet("QLineEdit { background-color: yellow }");
具体控件:nameEdit->setStyleSheet("background-color: yellow");
参考代码:https://doc.qt.io/qt-5/stylesheet-examples.html