Results 1 to 2 of 2

Thread: Not able to receive the custom event from the event loop

  1. #1
    Join Date
    Jul 2012
    Qt products
    Unix/X11 Windows

    Default Not able to receive the custom event from the event loop

    I'm have an issue in recieving custom events. I have defined the event #define finishEvent ((QEvent::Type)(QEvent::User+1000)) and posting the event in some part of our source code as below
    QCoreApplication: postEvent( this , new QEvent(finishEvent ) );

    The posted event is captured in the following function
    void CTestr::customEvent(QEvent *e)

    if( e->type() == finishEvent ){

    Both methods of post and receiving are in the same event loop(main thread) .

    The problem is that the posted event('finishEvent') is not sent to the customEvent function in release mode. But I am able to receive the event properly when I debug the code.

    We even added the event filter to the main thread but still was not able to see the event in the event filter.

    Can you please help me on this why the custom event message is not reciving in the customEvent() event function.

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

    Default Re: Not able to receive the custom event from the event loop

    Is the event loop running?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. Qt/MFC Event Loop - stop MFC receiving event?
    By Kaylx in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2012, 19:57
  2. Replies: 4
    Last Post: 6th August 2011, 02:40
  3. Replies: 10
    Last Post: 15th January 2010, 15:35
  4. Replies: 0
    Last Post: 23rd October 2008, 13:43
  5. Replies: 4
    Last Post: 25th June 2008, 12:03

Tags for this Thread


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.