有时候要改变Qt界面控件的样式,可以修改styleSheet来实现。
可以在主界面修改样式,那么主界面上的所有QPushButton都会修改样式的。
QPushButton
{color: white;background-color: #27a9e3;border-width: 0px;border-radius: 3px;
}QPushButton:hover
{color: white;background-color: #66c011;border-width: 0px;border-radius: 3px;
}QPushButton:pressed
{color: white;background-color: yellow;border-width: 0px;border-radius: 3px;
}QPushButton[pagematches=true]
{color: white;background-color: red;border-width: 0px;border-radius: 3px;
}
多谢,亲爱的美美。