我想将QCheckBox中TICK的颜色从黑色改成深蓝色,我试过QSS,但是不行:
QCheckBox {
background-color:blue;
color:blue;
}
使用 QSS 仅更改背景颜色,但我想更改刻度线的颜色。
我是否必须重载其paintEvent 才能执行?
谢谢。
------------</p>
现在我正在尝试 QSS 来解决它,
QCheckBox {
spacing: 5px;
}
QCheckBox::indicator {
width: 13px;
height: 13px;
}
QCheckBox::indicator:unchecked {
image: url(:/images/checkbox_unchecked.png);
}
QCheckBox::indicator:unchecked:hover {
image: url(:/images/checkbox_unchecked_hover.png);
}
QCheckBox::indicator:unchecked:pressed {
image: url(:/images/checkbox_unchecked_pressed.png);
}
QCheckBox::indicator:checked {
image: url(:/images/checkbox_checked.png);
}
QCheckBox::indicator:checked:hover {
image: url(:/images/checkbox_checked_hover.png);
}
QCheckBox::indicator:checked:pressed {
image: url(:/images/checkbox_checked_pressed.png);
}
QCheckBox::indicator:indeterminate:hover {
image: url(:/images/checkbox_indeterminate_hover.png);
}
QCheckBox::indicator:indeterminate:pressed {
image: url(:/images/checkbox_indeterminate_pressed.png);
}
这是来自 Qt ref 的 qss 示例,我如何获得 PATH ?这是什么意思?