QAbstractListModel Cannot call my method in qml
-
Hi.
I have inherited classclass MarkerModel : public QAbstractListModel { Q_OBJECTAnd I create my method
public slots: void addMarker(const QGeoCoordinate &coordinate);I register type in main.cpp
qmlRegisterType<MarkerModel>("MarkerModel", 1,0, "MarkerModel");In qml I am passing a pointer to this class.
And I want use all methods: 'rowCount', 'addMarker' and else in qml, but I get error:Cannot call methods 'addMarker' of nullHow I can fix this?