Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor useryy2's Avatar
    Join Date
    Apr 2011
    Posts
    89
    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;
    }

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672

  3. #3
    Regular Contributor useryy2's Avatar
    Join Date
    Apr 2011
    Posts
    89
    Thanks.All exist is in QObject document

    They should put them together with that example demos export "property" method.

Similar Threads

  1. How to call/load another QML file from QML ?
    By cadlg in forum [Archived] Qt Quick
    Replies: 5
    Last Post: 2011-07-28, 09:15
  2. How to debug qml app to nokia n97
    By Supernova746 in forum [Archived] Beginning Qt
    Replies: 1
    Last Post: 2011-03-14, 20:57
  3. How to export files in bld.inf to specific location?
    By AshramArzephucque in forum Symbian C++
    Replies: 1
    Last Post: 2008-01-09, 09:17
  4. How to export Notes files to PC
    By gbuico in forum Symbian C++
    Replies: 0
    Last Post: 2003-04-01, 17:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved