I write a c++ extension to QML.
Now the property "name" can be referenced in QML/JS file.
But how can I make the method "void abc()" also available in QML/JS file?
Currently, the error note is:
logic.js:30: TypeError: Result of expression 'filereader.abc' [undefined] is not a function.
Code:class FileReader: public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName ) Q_PROPERTY(int counter READ counter) public: FileReader(QObject* parent = 0); QString name(); int counter(); void setName(QString str); void abc(); private: QString m_name; int m_counter; }



