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

}

相关推荐
范特西.i4 天前
QT聊天项目(8)
开发语言·qt
枫叶丹44 天前
【Qt开发】Qt界面优化(七)-> Qt样式表(QSS) 样式属性
c语言·开发语言·c++·qt
十五年专注C++开发4 天前
Qt deleteLater作用及源码分析
开发语言·c++·qt·qobject
kangzerun4 天前
SQLiteManager:一个优雅的Qt SQLite数据库操作类
数据库·qt·sqlite
金刚狼884 天前
qt和qt creator的下载安装
开发语言·qt
追烽少年x4 天前
Qt中使用Zint库显示二维码
qt
谁刺我心4 天前
qt源码、qt在线安装器镜像下载
开发语言·qt
金刚狼884 天前
在qt creator中创建helloworld程序并构建
开发语言·qt
扶尔魔ocy5 天前
【转载】QT使用linuxdeployqt打包
开发语言·qt
YxVoyager5 天前
在VS2017中使用Qt的foreach宏,IntelliSense无法正确识别函数定义
c++·qt