When you return a QObject from a Q_INVOKABLE then the QML engine will assume that it is now the owner of the object and has to delete it.
In your case you don't want that, you want to keep ownership with the C++ side.
Qt Code:
QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership); return item;To copy to clipboard, switch view to plain text mode
Cheers,
_





Reply With Quote


Bookmarks