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

}

相关推荐
菜鸟看点3 小时前
自定义Cereal XML输出容器节点
c++·qt
漫步企鹅3 小时前
【蓝牙】Linux Qt4查看已经配对的蓝牙信息
linux·qt·蓝牙·配对
new_zhou4 小时前
Windows qt打包编译好的程序
开发语言·windows·qt·打包程序
看到我,请让我去学习12 小时前
Qt编程-qml操作(js,c++,canvas)
开发语言·qt
哈市雪花14 小时前
相机:Camera原理讲解(使用OpenGL+QT开发三维CAD)
qt·3d·交互·相机·图形学·opengl·视角
津津有味道16 小时前
Qt C++串口SerialPort通讯发送指令读写NFC M1卡
linux·c++·qt·串口通信·serial·m1·nfc
feiyangqingyun18 小时前
全网唯一/Qt结合ffmpeg实现手机端采集摄像头推流到rtsp或rtmp/可切换前置后置摄像头/指定分辨率帧率
qt·智能手机·ffmpeg
随意02318 小时前
Qt 事件
开发语言·qt
鸥梨菌Honevid18 小时前
Qt自定义控件(1)——QPaintEvent
开发语言·qt
Mr_Xuhhh2 天前
网络基础(1)
c语言·开发语言·网络·c++·qt·算法