Calling qmlRegisterType() in the registered class on debug crashes application
问题 I want to use qmlRegiterType() in registered class itself. I tried to use method from this topic but whenever I try to run application in debug mode it crashes the application with error read access violation at 0x0 Crashes on macro QML_GETTYPENAMES inside qqml.h (235 line). TestClass.h : class RegisterQmlTest : public QObject { Q_OBJECT public: explicit RegisterQmlTest(QObject *parent = 0); }; TestClass.cpp : QML_REGISTER(RegisterQmlTest); RegisterQmlTest::RegisterQmlTest(QObject *parent) :