Results 1 to 9 of 9

Thread: c++ and qml binding

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 5 Times in 5 Posts

    Default c++ and qml binding

    hi,
    how to receive signal from c++ to qml....using qdeclarativeview i am able to bind qml with c++ but i don't know how to bind c++ with qml....

  2. The following user says thank you to ganeshgladish for this useful post:


  3. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: c++ and qml binding

    Expose a C++ object to QML engine using QDeclarativeContext::setContextProperty() and use one of the means available (either the Connections element or javascript object.signal.connect(slot) expression) to connect a QML function to such object's signal.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:


  5. #3
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 5 Times in 5 Posts

    Default Re: c++ and qml binding

    thank you for your reply,
    here i am using qml for ui and c++ for database ....whenever i retrieve data from c++.... i want to give to qml..

  6. The following user says thank you to ganeshgladish for this useful post:


  7. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: c++ and qml binding

    You might want to consider exposing the data as a model.
    Maybe you can even use QSqlQueryModel?

    Cheers,
    _
    Last edited by anda_skoa; 8th May 2013 at 15:12.

  8. The following user says thank you to anda_skoa for this useful post:


  9. #5
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 5 Times in 5 Posts

    Default Re: c++ and qml binding

    thank you for your reply,
    but error is comming like this,
    QMetaObject::invokeMethod: No such method QDeclarativeRectangle::myQmlFunction(QVariant)
    QML function returned: ""

    thank you for your reply,
    but error is comming like this,
    QMetaObject::invokeMethod: No such method QDeclarativeRectangle::myQmlFunction(QVariant)
    QML function returned: ""

  10. The following user says thank you to ganeshgladish for this useful post:


  11. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: c++ and qml binding

    Show your code please.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. The following user says thank you to wysota for this useful post:


Similar Threads

  1. Add new QML component when binding with C++
    By alenn.masic in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2013, 16:59
  2. qt binding?
    By giugio in forum Qt Programming
    Replies: 4
    Last Post: 15th November 2012, 15:33
  3. binding text in QMl to c++
    By rajeshk.ict in forum Newbie
    Replies: 1
    Last Post: 16th March 2012, 09:40
  4. QUdpSocket binding
    By db in forum Qt Programming
    Replies: 0
    Last Post: 13th March 2008, 12:24
  5. binding
    By mickey in forum General Discussion
    Replies: 9
    Last Post: 26th September 2006, 22:54

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.