例如,我有带有自定义图标的QToolButton
我可以使用 QToolButton:hover
qss 让此图标在悬停时变亮吗?
最佳答案
您可以尝试以下选项吗:
选项 1:
尝试 PaletteRole
属性类型
http://doc.qt.io/qt-5/stylesheet-reference.html#paletterole
根据您的悬停需要,
QToolButton:hover { color: palette(light); }
选项 2:
使用更亮的 View 图标创建不同的图像。
并在将鼠标悬停在背景上时设置背景。
QToolButton:hover { background: url("LighterView.png") ; }
关于qt - 是否可以使现有图标在悬停时变亮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45713923/