PDA

View Full Version : QObject::connect stalls



arkain
25th April 2009, 20:48
Hello, I was wondering if I could get some advice. I'm attempting to send a signal to a QLCDNumber's display() slot.

I have the connection declared as.
QObject::connect( &a, SIGNAL(updateMiss(int)), n1MissLcd, SLOT(display(int)));

When I run the program it crashes, but does not when I take out the above connect.

The error code the program crashes with is '-1073741819'. Running the program with the debugger the program appears to go into an infinite loop inside of the QObject::connect() function.

The debugger stops at the line:
const QMetaObject *rmeta = receiver->metaObject();

Even though I have not set a breakpoint here. Any attempt to advance the program passed this point do not work, the debugger appears to try and repeat the line over and over.

Thanks, kai.

caduel
25th April 2009, 23:50
The only way this statement could crash, is if the pointers (particularly n1MissLcd) are invalid. Make sure the variable has been initialized.

arkain
26th April 2009, 00:26
You nailed it. I was trying to use a pointer that was part of the ui. I needed to go ui->n1MissLcd.

Thank you.