Results 1 to 13 of 13

Thread: emitting and catching signals

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Re: emitting and catching signals

    Should i place the connect command in classB's constructor to connect the signals as classB has classA's instance?

    EDIT

    I placed the connect code in the classB's constructor.The app compiled successfully but i got this in qDebug


    Qt Code:
    1. connect(classA_object,SIGNAL(receiving_finished()), this, SLOT(write_data()));
    2.  
    3. QObject::connect: Cannot connect (null)::receiving_finished() to classB::write_data()
    To copy to clipboard, switch view to plain text mode 
    Last edited by srohit24; 4th August 2009 at 05:36.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: emitting and catching signals

    classA_object is not created, i.e. classA_object == 0.
    EDIT: take a debugger in your hands and debug your programm step by step.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Feb 2009
    Posts
    143
    Thanks
    8

    Default Re: emitting and catching signals

    ok. but I have created a class object and I am using it make a function call.

    how can that be null?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: emitting and catching signals

    this message says another
    QObject::connect: Cannot connect (null)::receiving_finished() to classB::write_data()
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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
  •  
Qt is a trademark of The Qt Company.