[Interest] .remove() feature?

Thiago Macieira thiago.macieira at intel.com
Fri Sep 23 16:40:13 CEST 2016


On sexta-feira, 23 de setembro de 2016 05:59:28 PDT Roland Hughes wrote:
> 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?

Which removeAt() are you talking about?

QList
QVector
QGraphicsLayout (if so, which is the concrete class?)

You're talking about QHash, but it has no such function.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list