Event loop, qt event Loop
So what is an event loop? A typical graphic application often takes a long time to wait for user operations. The program remains idle until the person controlling the running of the program makes a decision very slowly (for example, clicking the mouse or pressing a key. When such an event occurs, the program is awakened and started to work, and some necessary operations are performed to respond to these events. After processing these events, the program returns to the sleep state and waits for the next event to occur. To reduce the memory usage of the program, Cocoa creates an automatic release pool before the program starts to process the event, and destroys the automatic release pool after the event processing is complete. In this way, the number of temporary objects accumulated by examples is kept to a minimum.