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
相关推荐
果果软件3 小时前
2026 后台管理系统选型:若依、JeecgBoot、芋道、NocoBase 和 GewuMind Boot 怎么选?金色熊族5 小时前
qt5.15.9编译qt-creator7.0.2源码码云社区7 小时前
Java家政服务系统源码:人员技能、服务范围与多商家业务落地FRing037 小时前
vue3干货总结3(defineOptions(Vue3.3)、defineModel(Vue3.4)、Pinia)Bczheng17 小时前
组件化服务端渲染模式SSR摇滚侠8 小时前
《On Java 中文版 基础卷》阅读笔记 接口 18CoderYanger8 小时前
Java EE 进阶:9.MyBatis 操作数据库(进阶)(第八弹):MyBatis Generatorwhitelbwwww9 小时前
CUDA C++实战--中级张紫娃9 小时前
Chrome插件-Stylus(屏蔽博客广告)Yannik9 小时前
在 Apple Silicon Mac 上用 Jenkins + Fastlane 搭建 iOS CI:从自动打包到 MR 检查流水线的完整实践