Results 1 to 2 of 2

Thread: Passing the object from QML to CPP file?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Passing the object from QML to CPP file?

    Hi,
    I am developing an app.
    Query:
    How to pass the object from QML to CPP file, what will be object type in QT?

    Code:
    Login.QML
    Qt Code:
    1. function metPassObject()
    2. {
    3.  
    4. var myCar = new Object();
    5. myCar.make = "Ford";
    6. myCar.model = "Mustang"
    7. myCar.year = 1969;
    8.  
    9. objQtCPPSearchVOne.metPassObject(myCar);
    10.  
    11. }
    To copy to clipboard, switch view to plain text mode 
    .H file:
    Qt Code:
    1. Q_INVOKABLE void metPassObject (type parameter)- what will be the parameter type?
    To copy to clipboard, switch view to plain text mode 
    .CPP file:
    Qt Code:
    1. void metPassObject(type parameter)
    2. {
    3. //How to access the object?
    4. }
    To copy to clipboard, switch view to plain text mode 

    Thanks is Advance.
    Last edited by anda_skoa; 29th July 2016 at 17:05. Reason: missing [code] tags

Similar Threads

  1. passing object to plugin
    By folibis in forum Qt Programming
    Replies: 3
    Last Post: 17th November 2011, 22:22
  2. Passing an object from one form to the other.
    By cbarmpar in forum Qt Programming
    Replies: 10
    Last Post: 3rd September 2008, 14:12
  3. passing an object
    By mickey in forum General Programming
    Replies: 3
    Last Post: 16th January 2008, 10:27
  4. Passing Object to dll
    By ankurjain in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 09:50
  5. passing a QPainter object to widgets
    By vratojr in forum Qt Programming
    Replies: 9
    Last Post: 11th January 2006, 15:27

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.