QSS的BUG?
新建GUI项目,在界面上放上一个QLabel,设置QSS
QLabel {
text-decoration: underline; /* 有效 */
}
QLabel:hover {
text-decoration: underline; /* 无效 */
}
设置默认样式可以出现下划线,但是想在鼠标悬停时才出现下划线则不可以显示了……
[解决办法]
http://qt-project.org/doc/qt-4.8/stylesheet-reference.html
QLabelSupports the box model. Does not support the :hover pseudo-state.
Since 4.3, setting a stylesheet on a QLabel automatically sets the QFrame::frameStyle property to QFrame::StyledPanel.
See Customizing QFrame for an example (a QLabel derives from QFrame).
[解决办法]
不是每个控件都支持所以的属性和状态的啊,看看这个吧
http://qt-project.org/doc/qt-4.8/stylesheet-reference.html