Results 1 to 7 of 7

Thread: QCoreApplication::postEvent: Unexpected null receiver

  1. #1
    Join Date
    Sep 2006
    Posts
    46
    Thanks
    2
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QCoreApplication::postEvent: Unexpected null receiver

    I am working with a QWorkspace and getting debug messages of QCoreApplication::postEvent: Unexpected null receiver on the console.

    I cannot find an entry for "Unexpected null receiver" and am guessing that it has to do with the widget that was added to the workspace no longer being available to accept postEvents.

    After preforming the following steps I will receive the postEvent message:
    1. workspace->addWindow()
    2. call show() on the widget

    (At this point if I close the window resize it or manipulate it in any way OTHER then maximizing it I will not receive the message if I were to close the window and restart at step 1)

    3. Through the UI call maximize() and then restore (showNormal) to restore the window size and position to its previous state before maximize.

    4. close() the window through the UI.

    (At this point if you start back at step 1 you will receive the messages as soon as show() is called)

    The widget added is a Singleton (same result with new() widgets) and I still have access to it so I am not sure what is causing these messages. It seems to have no bearing on the program as it still functions as designed, but would like to correct whatever is causing this output.

    The code is dependent on many other widgets so posting a code sample would take some time to trim it down to a small working example, so figured I would start with the question before investing the time needed to trim it.

    Tested on XP OpenSource 4.2.2; Any clarity on the situation or error would be much appreciated.

    edit: Will also receive this message twice on final close of the program.
    edit2: Only produces the message after a restore from a maximized window. A minimized window then restore will not produce the message.
    Last edited by merlvingian; 8th February 2007 at 18:30. Reason: More information

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCoreApplication::postEvent: Unexpected null receiver

    Did you manage to solve the problem?

  3. #3

    Default Re: QCoreApplication::postEvent: Unexpected null receiver

    I am having the exact same Problem also on XP QT 4.2.2 OpenSource.
    Anyone knows a solution to this issue or what i might be doing wrong?

  4. #4
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: QCoreApplication::postEvent: Unexpected null receiver

    Quote Originally Posted by Life is a Bug View Post
    I am having the exact same Problem also on XP QT 4.2.2 OpenSource.
    Anyone knows a solution to this issue or what i might be doing wrong?
    You probably use either one of below methods directly or indirectly and *receiver is a 0 pointer.

    QCoreApplication::postEvent ( QObject * receiver, QEvent * event )
    QCoreApplication::sendEvent ( QObject * receiver, QEvent * event )

  5. #5
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: QCoreApplication::postEvent: Unexpected null receiver

    Quote Originally Posted by merlvingian View Post
    I am working with a QWorkspace and getting debug messages of QCoreApplication::postEvent: Unexpected null receiver on the console.

    I cannot find an entry for "Unexpected null receiver" and am guessing that it has to do with the widget that was added to the workspace no longer being available to accept postEvents.
    I am not sure. You definitely get this message when you pass a zero pointer for receiver in postEvent. If you pass a non-zero pointer of a no longer existing workspace, I'd expect much uglier things.

    You really don't call postEvent somewhere directly?

  6. #6
    Join Date
    Sep 2006
    Posts
    46
    Thanks
    2
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCoreApplication::postEvent: Unexpected null receiver

    Sorry I never gave the follow up on the issue so here is what I found.

    Using 4.2.2 with WinXp Sp2 if you compile the Mainwindow -> MDI demo (example) with CONFIG += console you will get the same error results under the same test criteria.

    I have not tested it under 4.2.3 so not sure of the results. I can extrapolate the meaning of the error but was a concern that I could not find it in the documentation. I myself do not enjoy writing docs and understand how development takes precedence over docs most of the time so no hard feelings.

    At this point in time I am just ignoring it since it seems to have no ill affects but I do dislike seeing the messages

  7. #7
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: QCoreApplication::postEvent: Unexpected null receiver

    I think you can ignore this message, though I know how disturbing unwanted warnings on the console can be.

    I had the same warning once when during program start one object already posted an event to another object, which did not exist at that time. Of course I removed this sloppyness, but while it was present I have not seen any negative side effects either.

Similar Threads

  1. Replies: 7
    Last Post: 18th July 2006, 21:33
  2. postEvent() to a non-existing receiver
    By Artschi in forum Qt Programming
    Replies: 7
    Last Post: 1st June 2006, 14:44
  3. checking for null
    By drkbkr in forum General Programming
    Replies: 6
    Last Post: 13th March 2006, 21:54

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.