C++ dynamically create objects
Unsolved
QML and Qt Quick
-
Hello
I have problems with getting C++ to create an object from an existing .qml file with pre-defined properties. I just want C++ to create it, not change any settings or what ever.
So basically I have a button that executes createObject() when clicked. the function is supposed to create a Popup item, but nothing is appearing, and I get no errors when creating the object.
The code inside the func:
QQmlComponent comp(_engine, compPath); if (comp.status() != QQmlComponent::Ready) { qDebug() << comp.errorString(); return; } auto qmlitem = comp.create(); if (!qmlitem) { qDebug() << "qmlitem null"; return; }