技术栈

QCheckBox通过qss实现状态切换显示不同图标

Alphapeople2023-11-28 21:47
cpp 复制代码
QString qss = "QCheckBox::indicator:unchecked{ \
        image:url(:/resources/status_close.png); \
        } \
        QCheckBox::indicator:checked { \
        image: url(:/resources/status_open.png); \
        }";

    ui->checkBox->setStyleSheet(qss);
    ui->checkBox->setChecked(true);
上一篇:Python大数据考题
下一篇:ubuntu22.04配置shadowsocks
相关推荐
用户80553369803
3 天前
不止三件套:QObject 属性系统全关键字与运行时反射!
c++·qt
xcyxiner
3 天前
DicomViewer (vcpkg Windows和ubuntu编译)7
qt
Quz
8 天前
QML Hello World 入门示例
qt
xcyxiner
11 天前
DicomViewer (dcmtk读取dcm文件)5
qt
xcyxiner
11 天前
DicomViewer (后台线程处理文件)4
qt
xcyxiner
12 天前
DicomViewer (添加模型类)3
qt
xcyxiner
13 天前
DicomViewer (目录调整) 2
qt
xcyxiner
13 天前
dcmtk vtk vtk-dicom(gdcm) 编译(debug) v2
qt
桥田智能
15 天前
桥田智能 QT-650S:面向白车身焊装的 800kg 重载快换解决方案
开发语言·qt·系统架构
森G
15 天前
75、服务器源码解析---------云视频服务项目
linux·服务器·网络·c++·qt
热门推荐
012026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf022026年6月AI大模型全景报告:GPT-5.6、Claude Opus 4.8、Gemini 3.5,中美AI三足鼎立谁主沉浮?032026年6月AI行业全景:从百模大战到Agent元年,这30天发生了什么?04Trae国际版与国内版深度测评:AI原生IDE的双生花05GitHub 镜像站点06飞书长连接_事件订阅(接收消息,审批任务状态变更)07【AI】2026 年具身智能模型和世界模型总结08Claude Code、Codex、Cursor三分天下:2026年AI编程Agent生态全景剖析092026 AI 编程工具终极实战指南:Cursor vs Claude Code vs Copilot,开发者该怎么选?102026年AI架构实战:彻底解决OpenAI接口超时与封号,Python调用GPT-5.2/Sora2企业级架构详解(附源码+压测报告)