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
相关推荐
z***7515几秒前
【Springboot3+vue3】从零到一搭建Springboot3+vue3前后端分离项目之后端环境搭建likuolei5 分钟前
Eclipse 快捷键fruge1 小时前
仿写优秀组件:还原 Element Plus 的 Dialog 弹窗核心逻辑an86950011 小时前
vue新建项目w***95492 小时前
SQL美化器:sql-beautify安装与配置完全指南哈茶真的c2 小时前
【书籍心得】左耳听风:传奇程序员练级攻略喝养乐多长不高2 小时前
JAVA微服务脚手架项目详解(三)顾安r2 小时前
11.22 脚本打包APP 排错指南万邦科技Lafite3 小时前
1688图片搜索商品API接口(item_search_img)使用指南落落落sss3 小时前
java实现排序