Create dynamic QML components from within C++?
Hello
How to create a dynamic QML components from within C++?
I have tried this but it fails (below QObject pointer is Null):
QUrl t = QUrl(QStringLiteral("qrc:/path1/path11/path111/file.qml"));
QQmlComponent component(m_qmlEngine, t);
QObject *object = component.create(); // why object is NULL?
Is there another way to create a QML object from a .qml file?
Thanks
Mut
Re: Create dynamic QML components from within C++?
Please tell me you did not just post the same question three times.
Cheers,
_
Re: Create dynamic QML components from within C++?
Thanks for the reply. No at all, they have the same title.
Re: Create dynamic QML components from within C++?
They all seem to be about loading a QML component from C++.
But lets for a moment assume that you are not spamming and want your account to be disabled, then the question is: have you checked the component's errors?
Cheers,
_