Results 1 to 5 of 5

Thread: not getting the event from Postevent() to Custom event() in Qt4

  1. #1
    Join Date
    Jun 2008
    Posts
    21
    Thanked 1 Time in 1 Post

    Unhappy not getting the event from Postevent() to Custom event() in Qt4

    Hello,

    postEvent() is called from a separate thread, where as customEvent() is in main thread, After the postEvent() method called from thread , customEvent() of reciever is not receiving the event.

    Regards,
    node_ex.
    Last edited by node_ex; 24th June 2008 at 16:13.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: not getting the event from Postevent() to Custom event() in Qt4

    Try to provide more information. I've used it in a few projects and I never had problems with it. Did you pass something between QEvent::User and QEvent::MaxUser as event type?
    J-P Nurmi

  3. #3
    Join Date
    Jun 2008
    Posts
    21
    Thanked 1 Time in 1 Post

    Default Re: not getting the event from Postevent() to Custom event() in Qt4

    Hi,

    Thanks for the reply.

    I am converting Qt3 application to Qt4 application . Here application didn't call QApplication::exec() fn before calling postEvent fn.

    Event is passed by using QCustomEvent class .
    QApplication:ostEvent(QObject*,QCustomEvent*) is called in thread( which is not inherited from QThread ... basic c++ thread using pthread_create() function). customEvent(QCustomEvent*) function is located in the respected QObject class. This customEvent is not getting called after postEvent method is invoked.

    The same worked in Qt3, but not working in Qt4..

    Regards,
    node_ex.

  4. #4
    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: not getting the event from Postevent() to Custom event() in Qt4

    In Qt4 there is no virtual method customEvent that takes a QCustomEvent pointer.

  5. #5
    Join Date
    Jun 2008
    Posts
    21
    Thanked 1 Time in 1 Post

    Smile Re: not getting the event from Postevent() to Custom event() in Qt4

    hi,

    I used QEvent in place of QCustomEvent class and application works good.

    Thanks for your prompt help.

    Regards,
    node_ex.

Similar Threads

  1. delete custom event
    By Dmitry in forum Qt Programming
    Replies: 1
    Last Post: 15th October 2006, 16:55

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.