当前位置:网站首页>使用QT设计师界面类创建2个界面,通过按键从界面1切换到界面2
使用QT设计师界面类创建2个界面,通过按键从界面1切换到界面2
2022-07-05 17:14:00 【雪无香】
思路:按钮点击函数hide窗口1同时emit广播点击信号(自己加),main使用connect,窗口1发出点击信号,运行窗口2show显示函数
步骤一:Add new——QT——设计师界面类
步骤二:窗口一
signals:
void Show_EnterBtn();//登录按钮被点击信号
private slots:
void on_EnterBtn_clicked();//登录按钮相应函数:关闭登录界面,广播登录按钮点击信号
void Enter::on_EnterBtn_clicked()
{
this->hide();//隐藏窗口1
emit Show_EnterBtn();//广播按钮点击信号
}
步骤三:窗口二
private slots:
void Show_FuncSelect();//显示窗口2
步骤四:main函数
QObject::connect(&mEnter,SIGNAL(Show_EnterBtn()),&mFuncSelect,SLOT(Show_FuncSelect()));//点击按钮,关闭窗口1,显示窗口2
边栏推荐
- This 17-year-old hacker genius cracked the first generation iPhone!
- Machine learning 01: Introduction
- Compter le temps d'exécution du programme PHP et définir le temps d'exécution maximum de PHP
- Cartoon: interesting pirate problem (full version)
- C#实现水晶报表绑定数据并实现打印3-二维码条形码
- C # mixed graphics and text, written to the database in binary mode
- Debug kernel code through proc interface
- WR | Jufeng group of West Lake University revealed the impact of microplastics pollution on the flora and denitrification function of constructed wetlands
- 深入理解Redis内存淘汰策略
- URP下Alpha从Gamma空间到Linner空间转换(二)——多Alpha贴图叠加
猜你喜欢
统计php程序运行时间及设置PHP最长运行时间
解决“双击pdf文件,弹出”请安装evernote程序
Oracle Recovery Tools ----oracle数据库恢复利器
MySql 查询符合条件的最新数据行
33: Chapter 3: develop pass service: 16: use redis to cache user information; (to reduce the pressure on the database)
Machine learning 01: Introduction
The second day of learning C language for Asian people
ternary operator
Kafaka technology lesson 1
提高應用程序性能的7個DevOps實踐
随机推荐
Oracle缩表空间的完整解决实例
Understand the usage of functions and methods in go language
Tita 绩效宝:如何为年中考核做准备?
CMake教程Step5(添加系统自检)
2022 information system management engineer examination outline
Cartoon: looking for the best time to buy and sell stocks
漫画:如何实现大整数相乘?(整合版)
Flask solves the problem of CORS err
CMake教程Step3(添加库的使用要求)
Check the WiFi password connected to your computer
stirring! 2022 open atom global open source summit registration is hot!
Machine learning 02: model evaluation
漫画:如何实现大整数相乘?(下)
华为云云原生容器综合竞争力,中国第一!
Tita performance treasure: how to prepare for the mid year examination?
7 pratiques devops pour améliorer la performance des applications
統計php程序運行時間及設置PHP最長運行時間
MySQL之知识点(六)
In depth understanding of redis memory obsolescence strategy
SQL Server(2)