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
相关推荐
Scabbards_18 分钟前
面试Leetcode - Heap 堆IT_陈寒34 分钟前
Redis的DEL命令竟然没删掉数据?我踩的这个坑你得知道anOnion34 分钟前
构建无障碍组件之Menu and Menubar PatternJavaGuide42 分钟前
我用 Claude Code/ZCode+GLM-5.3 从零做了一款 Agent 游戏!Eason_Lou1 小时前
vue flow使用注意事项程序员清风1 小时前
专业再升级!程序员专属显示器明基RD280UG上手实测!JJJennie7771 小时前
Gemini 3.7 Flash 上线,Google 想让 AI 多干活小赵同学WoW2 小时前
1-2 TypeScript 中的 `any` 与 `unknown`six_2 小时前
C# 上位机(持续更新中)风雨_2 小时前
Git Worktree sourcetree完整使用指南