PDA

View Full Version : Problem with signals and slots



conexion2000
23rd March 2006, 09:56
Hello,
I have got signal: filtering(Element send,QCString& msg) and slot: filtering(Element& send,QCString& msg) (notice there is & after Element), and I want to modify send variable. But when I connect this signal to slot, this slot is never run. When I remove "&" slot runs. How to solve this problem?

jpn
23rd March 2006, 10:20
I have got signal: filtering(Element send,QCString& msg) and slot: filtering(Element& send,QCString& msg) (notice there is & after Element), and I want to modify send variable. But when I connect this signal to slot, this slot is never run. When I remove "&" slot runs. How to solve this problem?
The parameter types must match exactly. If you want a reference, the signal should also emit a reference.

signal: void filtering(Element& send, QString& msg)
slot: void filtering(Element& send, QString& msg)

wysota
23rd March 2006, 10:20
Turn the first parameter of the signal into a reference. The signatures of both the signal and the slot have to match.