Results 1 to 3 of 3

Thread: TypeError: Object [object Object] has no method 'sendData'

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    231
    Thanks
    141
    Thanked 6 Times in 5 Posts

    Default TypeError: Object [object Object] has no method 'sendData'

    qml file:

    Qt Code:
    1. onClicked:
    2. {
    3. Sender.address = "udpm://239.255.76.67:7687"
    4. Sender.ttl= 0
    5. Sender.channel= "A"
    6. Sender.data= "ddfdsf"
    7.  
    8. Sender.sendData()
    9. }
    To copy to clipboard, switch view to plain text mode 

    .h file:

    Qt Code:
    1. Q_INVOKABLE void sendData ();
    To copy to clipboard, switch view to plain text mode 

    main.cpp file:

    Qt Code:
    1. int main (int argc, char *argv[])
    2. {
    3. QGuiApplication app(argc, argv);
    4.  
    5. const char* ocuui = "OCUUI"; // @uri OCUUI
    6.  
    7. qmlRegisterType <Sender> (ocuui, 1, 0, "Sender");
    8.  
    9. Sender objS;
    10. objS.sendData ();
    11.  
    12.  
    13. QtQuick2ApplicationViewer viewer;
    14.  
    15. viewer.addImportPath("/home....");
    16. viewer.setMainQmlFile(QStringLiteral("..../main.qml"));
    17. viewer.showExpanded();
    18.  
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 
    I am using QtCreator. The thing I find odd is that when I type
    Qt Code:
    1. Sender.
    To copy to clipboard, switch view to plain text mode 
    it shows a list of the members of that class and that list "contains" sendData function.


    What point am I missing? Yes, sendData has been defined in the corresponding .cpp file.

  2. The following 2 users say thank you to TheIndependentAquarius for this useful post:


Similar Threads

  1. Replies: 0
    Last Post: 28th May 2012, 19:56
  2. How to call a function in the mother object from a child object?
    By Momergil in forum General Programming
    Replies: 4
    Last Post: 18th December 2011, 15:49
  3. Replies: 1
    Last Post: 8th November 2011, 22:27
  4. Replies: 4
    Last Post: 15th July 2011, 18:31
  5. Replies: 4
    Last Post: 20th August 2010, 13:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.