Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Construct QQmlListProperty from QList<MyClass>
jarosda last edited by
I am just faced to problem how to pass args to constructor of QQmlListProperty. I tried this, but with no success:
DataPacket is my custom class (subclassed from QObject) and _dataPacketList is instance.
I know there is more simple constructor
QQmlListProperty::QQmlListProperty(QObject * object, QList<T *> & list)
But in docs is written:
"Generally this constructor should not be used in production code, as a writable QList violates QML's memory management rules. However, this constructor can very useful while prototyping."
Could you please help me how to pass pointers to QList methods?
Thank you in advance.
Vincent007 last edited by
search "QQmlListProperty" inside Qt examples folder, you will get answers.