Results 1 to 3 of 3

Thread: QObject::connect stalls

  1. #1
    Join Date
    Apr 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default QObject::connect stalls

    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.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QObject::connect stalls

    The only way this statement could crash, is if the pointers (particularly n1MissLcd) are invalid. Make sure the variable has been initialized.

  3. #3
    Join Date
    Apr 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QObject::connect stalls

    You nailed it. I was trying to use a pointer that was part of the ui. I needed to go ui->n1MissLcd.

    Thank you.

Similar Threads

  1. Problem in QObject::connect( ... ) with smart_ptr ( Boost )
    By kunalnandi in forum General Programming
    Replies: 1
    Last Post: 15th October 2008, 07:44
  2. QObject::connect: No such slot !?!
    By Mystical Groovy in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2008, 18:31
  3. Replies: 6
    Last Post: 21st September 2007, 13:51
  4. QObject::connect says "no such signal"
    By MistaPain in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2006, 05:40
  5. QStringList in QObject::connect
    By DPinLV in forum Qt Programming
    Replies: 6
    Last Post: 6th September 2006, 17:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.