I am trying to port Qt4.8 QmlExtensionPlugin based plugin to Qt5. I am using this guide as help: http://qt-project.org/doc/qt-5.0/qtquick/qtquick-porting-qt5.html
In my plugin it used to be possible to create QDeclarativeComponent giving it the qml engine passed as a pointer in a call to initializeEngine (my plugin is derived from QDeclarativeExtensionPlugin).
After moving to Qt5 library built by myself - deriving from QQmlExtensionPlugin and changing QDeclarativeComponent to QQmlComponent and trying the same in initializeEngine callback I get an assert in QQmlThread::internallCallMethodInThread (line 292: Q_ASSERT(d->m_mainThreadWaiting == false);).
@void myPlugin::initializeEngine(QQmlEngine *engine, const char uri)
QString data = "some lines of qml";
myComponent.setData(data.toLatin1(), engine->baseUrl()); /assert after this line/
QObject styleObject = myComponent.create();
_ASSERT: "d->m_mainThreadWaiting == false" in file qml\ftw\qqmlthread.cpp, line 292
ASSERT: "d->m_mainThreadWaiting == false" in file qml\ftw\qqmlthread.cpp, line 292_
Any ideas what is going wrong here?