[Interest] .remove() feature?

Roland Hughes roland at logikalsolutions.com
Fri Sep 23 12:59:28 CEST 2016


Currently working at a site which is using 5.4 commercial under Ubuntu 
14.04 to develop an embedded system. Spent days tracking down a bug in 
the current project code base. There was an ugly for() loop which was 
processing a QHash (which really should have been a queue). They were 
calling .removeAt(x) and manipulating x to make things "seem" to process 
correctly but the next time a signal fired that slot the entry was still 
in the QHash object. The "fix" was to call call qApp->processEvents(); 
to drain the event queue right after the .removeAt(x) was called. 
Everything then worked as expected.

Yes, they should have used a queue and popped inside of a while loop, 
please let's not go down the how it should have been structured path. 
Has anybody else seen this behavior in 5.x? Is removeAt() really 
queueing a low priority event so the removeAt() doesn't actually happen 
until the event queue is processed completely?

Thanks,




More information about the Interest mailing list