PDA

View Full Version : how to get data from signal?



banlinhtienphong
27th April 2011, 13:07
assume,I have
connect(obj1,SIGNAL(changestatus(int),obj2,SLOT(ge tdata()));
how I get int value in signal from getdata function?

Zlatomir
27th April 2011, 13:25
Use a slot that has an int parameter, something like:


void CLASSNAME::getData(int inValue){
//use the value
}
//to connect use:
connect(obj1,SIGNAL(changestatus(int),obj2,SLOT(ge tdata(int))); //you only write the type at the connect statement

Read more here (http://doc.qt.nokia.com/4.7/signalsandslots.html)