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

}

相关推荐
前端市界15 分钟前
前端视角: PyQt6+Vue3 跨界开发实战
前端·qt·pyqt
誰能久伴不乏5 小时前
Qt 动态属性(Dynamic Property)详解
开发语言·qt
枫叶丹46 小时前
【Qt开发】常用控件(四)
开发语言·qt
茉莉玫瑰花茶18 小时前
Qt 常用控件 - 9
开发语言·qt
sqmeeting1 天前
QT6 如何在Linux Wayland 桌面系统抓屏和分享屏幕
linux·qt
姓刘的哦1 天前
Win10上Qt使用Libcurl库
开发语言·qt
hellokandy2 天前
QT QVersionNumber 比较版本号大小
qt·版本号·qversionnumber
常乐か2 天前
VS2022+QT5.15.2+OCCT7.9.1的开发环境搭建流程
开发语言·qt·opencascade
誰能久伴不乏2 天前
Qt TCP 客户端对象生命周期与连接断开问题解析
网络·qt·tcp/ip
kyle~2 天前
Qt---Qt函数库
开发语言·qt