View Full Version : sending signals to underlying qt code and vice versa

1st November 2010, 03:07

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.

4th November 2010, 09:12
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.

9th November 2010, 12:10
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