[Qt-interest] QEventLoop and QEvents

Eric Clark eclark at ara.com
Fri Feb 19 17:41:58 CET 2010


Sorry to reply to my own post, but I have determined that the event is being deleted before my event loop can execute it. Does anyone know of a way to keep Qt from deleting the event?

Eric

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Eric Clark
Sent: Friday, February 19, 2010 10:08 AM
To: Qt Interest (qt-interest at trolltech.com)
Subject: [Qt-interest] QEventLoop and QEvents

Hello All,

I have a QEventLoop that I am trying to use to "defer" events. Basically, when an input event occurs on my widget, I want to store that event for a very short period of time and execute it when that short period of time is up. So, what I thought I would do is add an event loop to my widget and post the events to that loop when they occur. Then, when the widget is ready to handle the events, I would just call processEvents on the event loop. The question I have is if anyone can tell me whether or not the event will be deleted before my loop gets to execute? At what point in the event handler does the event get deleted? If I have an event handler that just takes the event and posts it to another event loop, does Qt do something to ensure that that event does not get deleted until the other loop executes it? Or do I need to do something different to ensure that the event does not get deleted?

Thanks in advance!
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100219/06ccc50d/attachment.html 


More information about the Qt-interest-old mailing list