PDA

View Full Version : A Signal with Parameter from Qt C++ to QML



reinki0013
8th November 2011, 11:50
Hello,

i have a little problem...
the problem is that i want to send from my Qt C++ class (QDeclarativeItem) a signal to my qml-file with parameter.

for example my .h:

signals: void sendString(QString text);
in my .cpp file:

emit sendString("Testtext");

in my qml-file ??
i don`t know how do get the signal and how do i came to my string.

when i send a empty signal, it works great, but with parameter i don`t know how to do.
maybye you can help me :confused:

reinki0013
8th November 2011, 14:12
the main problem for me is, how do i can get some strings, int`s etc. from my c++ file to my qml-file.

i mean i have for example some data that i read in from the network - when i receive this data - i want to send them do my qml-file and show it there. i want to do only the graphic in qml - all other things in my qt c++ class.