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
相关推荐
hlvy1 分钟前
Claude Code 太难看?我开源了一个 Web GUI颜酱3 分钟前
提示词强化 3:JSON 与「流式」——前后端原理、BFF、以及两个示例页蜡台4 分钟前
VUE node EPERM: operation not permitted, unlink 错误程序猿乐锅5 分钟前
Java第十三篇:Stream流林三的日常7 分钟前
SpringBoot + Druid SQL Parser 解析表名、字段名(纯Java,最佳方案)deviant-ART12 分钟前
java stream 的 findFirst 和 findAny 踩坑点Wect12 分钟前
深度解析前端性能优化|晴 天|13 分钟前
AI智能助手功能实现青衫码上行19 分钟前
【从零开始学习JVM】字符串常量池历程里程碑26 分钟前
55 Linux epoll高效IO实战指南