【发布时间】:2019-05-11 09:38:22
【问题描述】:
我正在为我的 gui 使用 qss 样式表。它运作良好,但我想为我的自定义小部件定义不同的样式表。
例如,QPushbutton 的样式效果很好,但我想为MyQPushButton 应用不同的样式(从 QPushButton 扩展)。
我尝试过这样的事情:
MyQPushButton
{
color: #dcdcdc;
// some code here
}
QPushButton
{
color: #b1b1b1;
// some code here
}
但是QPushButton的样式已经应用在MyQPushButton上。
如何覆盖这种行为?
【问题讨论】:
标签: qt qt5 qtstylesheets