Aer*_*ate 1 c++ qt button stylesheet qt-creator
如何更改按钮颜色?我已经找到了写作的方法
button->setStyleSheet("* { background-color: rgb(255,125,100) }");
Run Code Online (Sandbox Code Playgroud)
在Ui_Window.h中
但每当我qmake,Ui_Window.h重新制作,我失去了我的颜色.
有谁知道如何永久保持按钮的颜色?我正在使用QT Creator.如果有人可以指示我= D.
非常感谢!
最简单的方法是在按钮上使用样式表:
backgroundColourButton->setStyleSheet("background-color: red");
Run Code Online (Sandbox Code Playgroud)