[Qt-qml] Emitting a C++ signal from QML

Colin Kern colin.kern at gmail.com
Fri Jun 18 05:19:43 CEST 2010


Hello,

I want to have a C++ object emit a signal when a QML element is
clicked on.  I've tried binding the onClicked event handler of the
MouseArea to the C++ signal, thinking it would work similar to how in
pure C++ you can connect a signal to another signal, but it didn't
seem to work.  Right now I have the onClicked event connected to a C++
slot that simply emits the signal, but it seems like there should be a
more elegant way to do this.

Thanks,
Colin



More information about the Qt-qml mailing list