Results 1 to 2 of 2

Thread: delete custom event

  1. #1
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default delete custom event

    In calculation thread create my custom event:
    Qt Code:
    1. DataEvent* ce = new DataEvent( 13 );
    2. QApplication::postEvent( receiver, ce );
    To copy to clipboard, switch view to plain text mode 

    When and where i'am must
    Qt Code:
    1. delete ce;
    To copy to clipboard, switch view to plain text mode 
    ?

  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: delete custom event

    Nowhere. It's explained in QApplication::postEvent() doc:
    The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted.
    J-P Nurmi

Similar Threads

  1. QDockWidget-title
    By moowy in forum Qt Programming
    Replies: 18
    Last Post: 23rd April 2014, 20:13
  2. pixmap onmousemove event help
    By bluesguy82 in forum Qt Programming
    Replies: 11
    Last Post: 9th August 2006, 14:15
  3. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. What's the relationship between signal/slot and event?
    By twosnowman in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 17:13

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.