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();
}

}

相关推荐
eggcode8 小时前
【Qt学习】Linux(ARM架构)在线安装Qt6.x
linux·qt·学习·arm
似水এ᭄往昔17 小时前
【Qt】--Qt概述
开发语言·c++·qt
人还是要有梦想的19 小时前
Qt WebEngine需要MSVC进行编译运行,QT如何用MSVC编译(包含64位和32位)
开发语言·qt·msvc
程序leo源20 小时前
Qt界面优化详解
linux·c语言·开发语言·c++·qt·c#
郝学胜-神的一滴20 小时前
Qt 高级开发 017:中文乱码
开发语言·c++·qt·程序人生·用户界面
誰能久伴不乏1 天前
【Qt 架构实战】从零手写工业级 Qt 日志系统:底层拦截与架构原理解析
qt·架构·日志
学习,学习,在学习1 天前
Modbus TCP 协议深度解析与 Qt 实战指南
网络·c++·qt·tcp/ip·modbus·qt5
Kelvin_Ngan1 天前
Qt vs2013 Qt modules设置无效
qt
一然明月2 天前
qt基本用法
开发语言·qt
代钦塔拉2 天前
Qt QThread最标准Worker线程用法(零崩溃、零内存泄漏)
qt