qt七个按钮进行互斥

void Home::on_toolButton_setting_clicked()

{

set_head_unchecked(qobject_cast<QToolButton *>(sender()));

}

void Home::set_head_unchecked(QToolButton *tool_button)

{

ui->toolButton_home->setChecked(false);

ui->toolButton_setting->setChecked(false);

ui->toolButton_warning->setChecked(false);

ui->toolButton_net_info->setChecked(false);

ui->toolButton_play_back->setChecked(false);

ui->toolButton_play_video->setChecked(false);

ui->toolButton_fc_realtime->setChecked(false);

复制代码
tool_button->setChecked(true);

if(tool_button->objectName()=="toolButton_home")
{
     home_page_video->show();
}
else
{
     home_page_video->hide();
}

}

相关推荐
Quz1 小时前
QML 分隔线:Rectangle、菜单与工具栏分隔线用法
qt
Quz1 小时前
QML PathView 入门:直线路径与曲线路径
qt
实心儿儿2 小时前
Qt — 音视频文件
qt·音视频
Cx330❀6 小时前
【Qt 进阶指南】详解 Qt 常用标准对话框与主窗口组件架构
开发语言·qt·ui·性能优化·架构·图形渲染
阿钱真强道7 小时前
25 嵌入式操作系统 | 设备面板:用 Qt 控件把“设备“画出来(本节不接串口)
开发语言·qt·flask·架构设计·协议契约
kaixin_learn_qt_ing8 小时前
使用 PySide6 编写Qt程序
qt
艾莉丝努力练剑8 小时前
【QT】系统相关:多线程QThread基础
开发语言·网络·c++·qt·学习·大模型
xcyxiner1 天前
DicomViewer24 修复编译bug(window test 失败)
前端·qt
sycmancia1 天前
Qml——Rectangle元素
qt
sycmancia1 天前
Qml——Item元素
qt