PDA

View Full Version : Connection doesn't work



^NyAw^
20th March 2007, 11:52
Hi,

Why this code don't connect,


bool bC1 = connect(this,SIGNAL(emetreImatge(const HImage&,bool,int,int)),
(QObject*)m_pqMagicQt,SLOT(PintarImatge(const HImage&,bool,int,int)),
Qt::QueuedConnection);


and this other one connect:


bool bC1 = connect(this,SIGNAL(emetreImatge(HImage,bool,int,i nt)),
(QObject*)m_pqMagicQt,SLOT(PintarImatge(HImage,boo l,int,int)),
Qt::QueuedConnection);


I have redefined the slot with "const HImage&" in the first way but it doesn't going well.

I have looked at "examples/threads/mandelbrot" and I am doing the same: conecting one working Thread with the Main Thread(for GUI displaying).

I also have registered the "HImage" with:


int iIDRImatge = qRegisterMetaType<HImage>("HImage");



Any idea?

Thanks,

wysota
20th March 2007, 11:54
A wild guess is that the signal or slot doesn't send/accept a reference. What warning message do you get during connection?

^NyAw^
20th March 2007, 12:09
Hi,

Sorry wysota, I have forgiven to redefine the signal in the header file: :rolleyes:


void emetreImatge(const HImage&,bool,int,int);


Now it connects perfectly. ;)

Thanks for your reply