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
相关推荐
星空2 小时前
金蝶苍穹build.gradle配置泯泷3 小时前
那段文字是谁删的?Yjs 14 正式版之前,一套删除归属方案的实现与边界hold?fish:palm3 小时前
34 合并K个升序链表步行cgn5 小时前
Spring 基于 XML 的自动装配:byName 详解野槐5 小时前
前端项目优化(有了我,会发生...)大帅点兵6 小时前
Apache Ant 1.9.9 完整讲解幸运小圣6 小时前
PointerEvent 常用属性与事件整理【JavaScript】LuTshoes6 小时前
spring ai 实战 手搓 PlaneExecuteAgent这料鬼有毒6 小时前
二刷hot100-73.矩阵置零caoerzhong6 小时前
JeeWMS 开源仓库管理系统二次开发与接口对接实战:Java WMS 如何与 ERP、MES 和自动化设备打通