QList<customObj *> in QML not working on raspberry
-
Hello,
I develop application on desktop. Now I'm done, and I need deploy it to raspberry.Compilation (on raspberry) was success.
When I run application I cannot access to my sensors -list - QLlist<SENSOR *>.
I make some test:
When I push button print count of sensors - but - qml prin "undefined".But If I run same test code on my desktop - it's working.
If I change QLlist<SENSOR *> to QLlist<QObject *> - code working on my desktop and on raspberry too.
So I make another test (if SENSOR is really registred in QT):
SENSOR * sensor=new SENSOR(); sensor->ID="Hello;"; engine.rootContext()->setContextProperty("sensor",sensor);
Button{ text:"test" onClicked: { console.log(sensor.ID) } }
This code working on desktop even on raspberry.
So why QLlist<SENSOR *> not working on raspberry (QT5.11) but work on my desktop (QT5.14,QT5.15,QT5.11.3)?
SENSOR class is inherit form QObject, and in header I have
Q_DECLARE_METATYPE(SENSOR);
QList is registred as property:
Q_PROPERTY(QList<SENSOR *> sensorsUnit READ getSensorUnitList NOTIFY sensorUnitListChange) //getSensorUnitList -> QList<SENSOR *> getSensorUnitList()const;
Thank you for any help
-
Try changing the QList<SENSOR*> to QList<QObject*>