[Interest] QEventLoop ::hasPendingEvents() replacement?

Thiago Macieira thiago.macieira at intel.com
Tue Jun 25 18:08:32 CEST 2019


On Tuesday, 25 June 2019 08:00:02 PDT Fabrice Mousset | GEOCEPT GmbH wrote:
> Hi all,
> 
> Since Qt 5.3 QAbstractEventDispatcher::hasPendingEvents() has been set
> "obsolete". Is there an alternate way to know if a QEventLoop has pending
> events?

The reason it's obsolete is that it's a race condition. Since the race can't 
be fixed, there will be no replacement.

I suggest you replace the call with "true" or "false", depending on how your 
code around it would react to an event being posted by another thread at just 
the wrong moment.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Interest mailing list