[Interest] can the QRegExpEngine cache acces objects belonging to an unloaded library during global destruction?

René J. V. Bertin rjvbertin at gmail.com
Tue Jan 30 22:51:55 CET 2018

Thiago Macieira wrote:

> Q_GADGET macros, then automatically moc them. Headers produce
> moc_headername.cpp, sources produce sourcename.moc. #including both is a good
> idea

Ah, that's the difference I missed! That worked, but only after I changed the 
class definition from

class EngineCache : public QCache<QRegExpEngineKey, QRegExpEngine>
    , public QObject


class EngineCache :
    public QObject,
    public QCache<QRegExpEngineKey, QRegExpEngine>

Apparently moc doesn't really know how to handle `QCache<QRegExpEngineKey, 
QRegExpEngine>` as the primary class signature. I hope that the difference in 
primary parent class between QT_BOOTSTRAPPED and normal mode won't lead to 

Something else: is there a point to using QBasicMutex? I understand it's 
supposed to be faster, but QMutexLocker doesn't have a ctor for the class so it 
probably gets promoted to a QMutex. Don't you lose the performance advantage 
that way, and in addition pay for the conversion?


More information about the Interest mailing list