Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSharedPointer in QML
maxj last edited by maxj
is it possible to use QSharedPointer or QPointer in QML via Q_PROPERTY?
I have declared an Class "Contact" which inherits QObject.
At the bottom of "Contact.h" i declared:
and in main.cpp:
qmlRegisterType<Contact>("mj.contact", 1, 0, "MContact");
but when i try to access any property of Contact in qml all values/propertys of Contact are 'undefined'
I think this should be possible but what is my mistake?
Your mistake is thinking it should be possible. It's not.
Pass the object as a raw pointer.
maxj last edited by