Pending events

Giuseppe Corbelli corbelligiuseppe at mesdan.it
Wed Jul 29 08:12:37 BST 2020


On 7/28/20 10:36 AM, Timothy W. Grove wrote:
> Is there a way to view pending events in the event queue? Thanks.

This is a Qt question, not a PyQt one.

A quick look at Qt sources shows:

void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags)
{
     QThreadData *data = QThreadData::current();
     if (!data->hasEventDispatcher())
         return;
     data->eventDispatcher.load()->processEvents(flags);
}

Since QThreadData is private there's no direct way to look into the 
event queue.

You could however fiddle with QAbstractEventDispatcher and/or event 
filters, depending on what you need to do it may be enough.

-- 
Giuseppe Corbelli


More information about the PyQt mailing list