qt icon状态

在qt designer中我们可以看到,一些控件允许设置图标,然后在它下面会出现很多项目
在这里插入图片描述
对这些不同项目的解释见 enum QIcon::Mode

ConstantValueDescription
QIcon::Normal0Display the pixmap when the user is not interacting with the icon, but the functionality represented by the icon is available. 控件可用时,如果没有检测到交互事件(如鼠标事件),显示该图标
QIcon::Disabled1Display the pixmap when the functionality represented by the icon is not available.控件禁用时,显示该图标
QIcon::Active2Display the pixmap when the functionality represented by the icon is available and the user is interacting with the icon, for example, moving the mouse over it or clicking it. 控件可用时,并且检测到交互事件(如鼠标事件),显示该图标
QIcon::Selected3Display the pixmap when the item represented by the icon is selected. 控件被选中时,显示该图标

QIcon::State

ConstantValueDescription
QIcon::Off1Display the pixmap when the widget is in an “off” state. 开关控件处于off状态(check)时显示该图标
QIcon::On0Display the pixmap when the widget is in an “on” state. 开关控件处于on状态(uncheck)时显示该图标

通过QIcon::addPixmapQIcon::addFile设置不同情况下的图标

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值