【发布时间】:2016-04-11 19:23:07
【问题描述】:
我用这个样式表在 Qt Designer 中创建了QPushButton:
QPushButton#pushButton {
background-color: #ffffff;
}
QPushButton#pushButton:disabled {
background-color: yellow;
}
QPushButton#pushButton:pressed {
background-color: orange;
}
QPushButton#pushButton:focus:pressed {
background-color: black;
}
QPushButton#pushButton:focus {
background-color: green;
}
QPushButton#pushButton:hover {
background-color: red;
}
QPushButton#pushButton:checked {
background-color: pink;
}
它可以工作,但是当我在属性中选中“flat”时,它就不再工作了,我想问你为什么?如果我需要平坦的QPushButton,我该怎么做?
【问题讨论】:
-
上面这个非常非常非常非常有用!感谢分享
-
@KGCybeX 欢迎您:)
标签: qt qtstylesheets qpushbutton flat