Results 1 to 3 of 3

Thread: QObject::disconnect: Unexpected null parameter

  1. #1
    Join Date
    Apr 2014
    Posts
    125
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Question QObject::disconnect: Unexpected null parameter

    Hi;

    Why m I receiving this warning;

    QObject::disconnect: Unexpected null parameter

    with this code:

    // First disconnect:
    ok = QObject::disconnect(m_reply, SIGNAL(finished()), this, SLOT(onFinished()));

    // then clear the pointer
    m_reply = NULL;

    Thanks in advance.

    Mut.

  2. #2
    Join Date
    Jul 2015
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QObject::disconnect: Unexpected null parameter

    Quote Originally Posted by mut View Post
    Hi;

    Why m I receiving this warning;

    QObject::disconnect: Unexpected null parameter

    with this code:

    // First disconnect:
    ok = QObject::disconnect(m_reply, SIGNAL(finished()), this, SLOT(onFinished()));

    // then clear the pointer
    m_reply = NULL;

    Thanks in advance.

    Mut.
    check if m_reply is NULL before
    ok = QObject::disconnect(m_reply, SIGNAL(finished()), this, SLOT(onFinished()));

    and not?
    // then clear the pointer
    delete m_reply;
    m_reply = NULL;

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QObject::disconnect: Unexpected null parameter

    And don't use NULL.

    Either use 0, Q_NULLPTR or nullptr.

    This is C++, not C :-)

    Cheers,
    _

Similar Threads

  1. Replies: 6
    Last Post: 29th September 2015, 16:59
  2. Replies: 1
    Last Post: 19th August 2015, 09:59
  3. Replies: 1
    Last Post: 27th June 2014, 16:29
  4. QCoreApplication::postEvent: Unexpected null receiver
    By mortoray in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2010, 22:14
  5. QCoreApplication::postEvent: Unexpected null receiver
    By merlvingian in forum Qt Programming
    Replies: 6
    Last Post: 13th March 2007, 20:25

Tags for this Thread

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.