Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have understood the following regarding QApplication's exec function:

QApplication exec starts the main event loop. It launches the GUI. It processes the signals and calls appropriate slots on receiving them. It waits until exit is called and returns the value which was set in exit.

Now, when we say event loop, does it mean that there is some while loop running in the internal code of Qt, and in that while loop the method of handling signals and slots is written?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
151 views
Welcome To Ask or Share your Answers For Others

1 Answer

Now, when we say event loop, does it mean that there is some while loop running in the internal code of Qt, and in that while loop the method of handling signals and slots is written?

In a sense, yes. Most software these days sits and waits for events -- user input, network traffic, timer events, sensors, etc. -- and responds accordingly.

This is not specific to Qt. It's a common design pattern you'll find everywhere from Windows to Android to Arduino.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...