QGridLayout *layout = new QGridLayout;
box =new QCheckBox();
box->setText("复选框");
box1 =new QCheckBox();
box1->setText("&C复选框1");
box1->setDisabled(true);
layout->addWidget(box,0,0);
layout->addWidget(box1,0,1);
connect(box,SIGNAL(stateChanged(int)),this,SLOT(ShowLog(int)));
connect(box1,SIGNAL(stateChanged(int)),this,SLOT(ShowLog(int)));
ui->centralWidget->setLayout(layout);
void MainWindow::ShowLog(int state)
{
qDebug()<<state<<" "<<box->isChecked()<<" "<<box->isTristate();
if(state)
box1->setEnabled(true);
else
box1->setEnabled(false);
}
qt checbox设置不可用,快捷方式,选中,取消事件
jena_wy2023-08-20 20:21
相关推荐
古茗前端团队42 分钟前
急招!前端|测试|后端|产品(名额多,速来)Lsx_1 小时前
不只是 Prompt:用 Superpowers Skill 给 AI 编程装上工程化工作流用户938515635071 小时前
从 Prompt 到 Harness:AI 工程化的三年跃迁与实战解码小碗细面1 小时前
前端 Prompt 工程实战:如何搭建场景化 Prompt 库阿瑞IT1 小时前
2026年 AI Agent 生产化落地全景:四大高频故障根因分析与工程解法木木剑光2 小时前
我开源了一个 React 组件库,沉淀了多个高频组件和实用 Hookskyriewen2 小时前
DeepSeek API 高峰时段涨价 2 倍,便宜大碗的时代要结束了?Moment2 小时前
牛逼,NextJs 从 16.3 开始全面拥抱 Agent Native 🥰🥰🥰沸点小助手2 小时前
6月沸点活动获奖名单公示|本周互动话题上新🎊Csvn3 小时前
React 19 `use()` 来了:以后数据加载可以不用 useEffect?