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
相关推荐
茶本无香18 分钟前
Java调用Shell脚本执行SQL数据库操作:从入门到实战Eloudy23 分钟前
ReAct 原理简介风流 少年28 分钟前
Spring AI 2.0:MCP天疆说1 小时前
01 硬件选型与 llama.cpp 部署:4× RTX 5880 Ada 跑 DeepSeek-V4-FlashZJU_统一阿萨姆1 小时前
【DSH】如何将 DeepSeek Harness 嵌入生产环境?万字解构 DeepSeek Agent Harness 的运行机制与安全边界用户921080262861 小时前
4. 前端地图大量点位实时更新优化:后端推增量,前端做 diff水无痕simon1 小时前
3 短信应用场景以及平台架构mister_guo2 小时前
JVM 内存管理原理及生产配置实战:从“参数能启动”到“内存可控”风流 少年2 小时前
Spring AI 2.0:Tool