Results 1 to 3 of 3

Thread: sending signals to underlying qt code and vice versa

  1. #1
    Join Date
    Oct 2009
    Posts
    47
    Thanks
    10

    Default sending signals to underlying qt code and vice versa

    Hi,

    I was curious if there was any example code out there other than on Qt's website that explains how to make QML objects send signals to underlying Qt code and vice versa.

    The examples on qt's website are very small and I'm still confused how its suppose to work.

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

    Default Re: sending signals to underlying qt code and vice versa

    Signals are sent by calling them as functions from within qml code if you really need to send them explicitly. But a good design would be if signals were sent by the C++ backend only so that QML would only handle the presentation layer.
    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.


  3. #3
    Join Date
    May 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: sending signals to underlying qt code and vice versa

    I am not sure if this would work for the case you have in mind, but you can bind QML properties to Qt properties. So you don't have necessarily to send a signal to link a QML property to an Qt property, you can do it using a binding. This means you need to expose the property in Qt code as Q_PROPERTY.

    See "Binding Element" at the bottom of http://doc.qt.nokia.com/4.7/propertybinding.html

Similar Threads

  1. Mapping JavaScript object to QT (and vice versa)
    By leoalvesmachado in forum Newbie
    Replies: 2
    Last Post: 30th June 2010, 20:00
  2. Replies: 0
    Last Post: 25th March 2010, 13:10
  3. conversion between string to hex and vice versa
    By mohanakrishnan in forum Newbie
    Replies: 2
    Last Post: 5th December 2009, 12:25
  4. Convert QByteArray to object and vice versa
    By DiamonDogX in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2009, 21:07
  5. sending signals to ancestors
    By magland in forum Qt Programming
    Replies: 3
    Last Post: 6th October 2007, 12:51

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.