relation between QEventloop and QAbstractEventDispatcher
What is the relation between QEventloop
an开发者_JAVA百科d QAbstractEventDispatcher
?
Event loop is a loop that runs the event dispatcher until the loop is broken.
But in Documentation of QEventLoop
there is no single method that takes an QAbstractEventDispatcher
as argument.
Why should there be a method in QEventLoop that takes a Subclass of QAbstractEventDispatcher
?
In every application, or more precise in every thread there is only one QAbstractEventDispatcher
subclass instance which is only processing incomint system/Qt events and dispatches them to the Q(Core)Application
. The QAbstractEventDispatcher
is only a helper, it isn't listening to events, it has to be triggered, for example by a QEventLoop
. The Eventloop is basically a infinite loop which uses the thread global event dispatcher to dispatch events if need be.
I hope that clears it up a little.
精彩评论