First, talk about the Qt event processing, under the Windows platform, of course, without Win32:
Basic structure of the WIN32 program:
1. Registration window;
2. Create a window;
3. Start the event cycle consisting of GetMessage and dispatchmessage;
4. The registered callback function WndProc is responsible for the corresponding various events;
Windows maintains a message queue for each Windows program that is currently executing:
The above is a simple introduction to the Windows message processing process;
Second, the QT event entry class:
Qapplication
:p ublic qguiapplication
:p ublic qcoreapplication
:p ublic Qobject (qobject Three responsibilities: memory management, introspection, event processing system)
GUI Application qapplication
GUI uses only QML qguiapplication
Non-GUI application qcoreapplication
First introduce a program can be started, capture system-level events, after capture if issued, before allowing Qt to do further processing, if not issued, QT is dumbfounded.
Third, the next step into the QT processing event flow, with flowcharts and some pseudo-code instead, it may be easier for everyone to understand:
The next step is the familiar process. Follow-up will specifically analyze the various levels of QT event-related issues.
Reprint marked the source, together learn to communicate, respect for the fruits of our work, together to create a civilized, loving community environment.
Preliminary anatomy of the whole process of QT event processing (Windows)