[Qt-interest] How to queue events until I say to process them...
Jeffrey Brendecke
jwbrendecke at icanetix.com
Tue Feb 9 21:34:55 CET 2010
I see a couple of options:
1. Create some functors wrapping what you want to do and put them in a QQueue
and process when ready.
2. Use a function type such as the boost function object adapters and put them
in a QQueue.
Option 1. allows you to include some state to be stored for use by the
function at call time or thereafter in addition to providing more flexibility
with respect to return types and signature overrides.
--------------------
Date: Tuesday 09 February 2010 21:10
From: Eric Clark <eclark at ara.com>
To: "Qt Interest (qt-interest at trolltech.com)" <qt-interest at trolltech.com>
Cc:
Subject: [Qt-interest] How to queue events until I say to process them...
--------------------
> Hello Everyone,
>
> I would like to implement an event queue of some sorts that does not
> actually process the events until I say it can process them. I have
> somewhat of an idea of what I need to do. Basically, I should override the
> QCoreApplication::notify and instead of notifying the object immediately,
> post it to the object's event queue for processing when the object is
> ready. Before I try this, I would like to know two things:
>
>
> 1. When does the QEvent object actually get deleted? Is it after the
> call to notify? Or is it in the default implementation of notify, thus
> making it my responsibility to delete the event if I override
> QCoreApplication::notify?
>
> 2. Is there a better, or should I say a Qt, way of implementing this
> type of queue?
>
> Thank You in advance!
> Eric
More information about the Qt-interest-old
mailing list