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
相关推荐
吴声子夜歌20 小时前
ES6——Iterator和for...of循环详解砍材农夫20 小时前
spring-ai 第八模型介绍-图像模型小李子呢021120 小时前
前端八股3---ref和reactive落魄江湖行20 小时前
基础篇三 Nuxt4 组件进阶:插槽与事件传递kerli20 小时前
Compose 组件:LazyColumn 核心参数与 key/contentType 详解好运的阿财20 小时前
“锟斤拷”问题——程序中用powershell执行命令出现中文乱码的解决办法踩着两条虫20 小时前
VTJ.PRO AI + 低代码实战:接入高德地图绝世唐门三哥20 小时前
React性能优化:memo、useMemo和useCallback全解析橘子hhh20 小时前
Netty基础服务器实现兔子零102420 小时前
Claude Code 都把宠物养进终端了,我做了一个真正能长期玩的中文宠物游戏