magland
14th June 2007, 08:13
I need to connect a signal retrieved from QMetaMethod::signature(). There doesn't seem to be a Qt function to achieve this, so I had a look at the SIGNAL macro, and so this is what I do (basically stick a "2" in front of the signature):
QMetaMethod mymethod=...;
char holdstr[1000];
sprintf(holdstr,"2%s",mymethod.signature());
connect(obj,holdstr,this,SLOT(myslot()));
It's a hack and I don't like it -- not even sure it will work all the time. Is there a better way to achieve this?
Thanks
QMetaMethod mymethod=...;
char holdstr[1000];
sprintf(holdstr,"2%s",mymethod.signature());
connect(obj,holdstr,this,SLOT(myslot()));
It's a hack and I don't like it -- not even sure it will work all the time. Is there a better way to achieve this?
Thanks