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
相关推荐
鹿角片ljp5 小时前
LeetCode 64:最小路径和复盘|二维 DP 与 ACM 模式完整写法+VX:Fegn08956 小时前
计算机毕业设计|基于springboot + vue蛋糕店管理系统(源码+数据库+文档)泡海椒6 小时前
PDF 表格样式优化:jquick-pdf 边框、圆角、背景色半个落月6 小时前
LangChain.js Agent Memory 实战(下):用 Milvus 构建可检索的长期记忆半个落月6 小时前
LangChain.js Agent Memory 实战(上):从内存对话、文件持久化到截断与摘要Nicander7 小时前
我给 Excalidraw 做了一个本地工作区:DrawSpace景熙55237 小时前
15.Java 8 Stream 流入门到实战wno7048 小时前
Spring Security权限控制杨运交8 小时前
[071][验证码模块]基于Spring拦截器的验证码认证设计思想