当前位置:网站首页>QT method of exiting application (exe)
QT method of exiting application (exe)
2022-06-25 21:13:00 【Rabbit cloud program】
When you want to exit the application , That is to close app When applied , At this point, you don't have to worry about the life cycle of processes and threads , In fact, even if you make the whole program close illegally when you exit , direct crash It's OK to drop it .
But as a good programmer, you should think more about it , Whether all memory is released when exiting , Check whether you should make a pop-up prompt for exit or a prompt for successful exit when exiting , It's more human , This is a must for programmers .
There is also a question about when you will send an exit app The order of , Or close the window , Before quitting, you can complete your business and logic , Without affecting the user experience . I saw someone sending out app Sleep when you quit 5s, Cause jamming delay .
QT There are several ways to exit the program in
Method 1:

Method 2:

You can add the above method to the slot function of the closing program . Of course, if you don't care Illegal closing , You can make one crash, Directly destruct an illegal pointer , cause app Flash back and collapse .
There is also a way to close the window :
close() // Just close a window Also added to the slot function
First click on X when , Will respond to closeEvent event , So just do one thing in the event function
边栏推荐
- HMS core actively explores the function based on hardware ear return, helping to reduce the overall singing delay rate of the singing bar by 60%
- Heavy update! Yolov4 latest paper! Interpreting yolov4 framework
- The user name and password will be automatically filled in when adding a form
- JS__ Prototype, prototype chain, call/apply__ Duyi
- Soft test intermediate simple notes
- [nailing scenario capability package] company / Park Digital canteen
- [nailing - scenario capability package] nailer card
- Lesson 1 Preparation
- Alicloud disk mounted locally
- [distributed system design profile (1)] raft
猜你喜欢
Boomfilter learning

Vbpr (visual Bayesian personalized ranking) paper summary

MySQL is slow to add indexes_ Why is your SQL so slow? Why is your MySQL index invalid?
Cross project measurement is a good helper for CTOs and PMOS

Heavy update! Yolov4 latest paper! Interpreting yolov4 framework
8 minutes to understand the wal mechanism of tdengine
![[nailing scenario capability package] exhibition admission](/img/a1/5900ad0d3c89f21da3a2d96c91943a.jpg)
[nailing scenario capability package] exhibition admission

Unable to connect to the server remotely locally using the Jupiter notebook
Interviewer: why does TCP shake hands three times and break up four times? Most people can't answer!

Install JDK, MySQL and nexus under Linux (tar package installation)
随机推荐
OLED driven learning based on ssd1306 (II): addressing mode of ssd1306
Insert and update each database
109 practical shell scripts
Cvpr2019 | the latest cvpr2019 papers are the first to read!
COMP9024
Lesson 4 beautifulsoup
Literals and type conversions of basic data types
Openocd compilation and installation
Great changes in the interaction between people and the digital world
[important notice] developer document update (12.13-12.19)
Yanjiehua, editor in chief of Business Review: how to view the management trend of business in the future?
Record some questions about MySQL (DNS reverse resolution in Linux)
Is it safe for qiniu school to open a securities account?
Local variables and global variables in C language
Common optimization of e-commerce server system architecture
Lantern Festival, learning at the right time! Novice training camp attacks again, learning buff continues to fill up
Code program related problems troubleshooting directory
How to buy the millions of medical insurance for children? How much is it a year? Which product is the best?
couldn‘t be accessed by user ‘_ apt‘
Lesson 3 urllib