Fix teardown hang with QuickPixmapReader
QQuickPixmapReader is a QThread subclass that encapsulates the thread
usage in the constructor/destructor.
The current code is broken if the QQmlEngine (and thus
QuickPixmapReader) are deleted as children of the QCoreApplication. At
this point no new events are posted and the deleteLater doesn't reach
the relevant thread. We then hang forever waiting on a thread that will
never quit.
The eventloop_hack was added in 2010
(ff983ee8257b79143911ca58ebedc49b1660a0c4 before Qt split) with the
comment that QThread::quit was not thread safe. Current docs say it is.
Pick-to: 6.12
Change-Id: I0ae1f6c5cf269dfe5cb7b96c682f50692b210da1
Reviewed-by: Marco Martin <mart@kde.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>