[RQt-devel] issue with getting too many events

Michael Lawrence lawrence.michael at gene.com
Thu Jun 16 15:49:49 CEST 2011


I don't know how to discard events in the queue with GTK+. The function
gdk_flush() will send all events in the queue to the client and wait until
all are processed. The events are not deleted; they are processed. The Qt
equivalent is QCoreApplication::flush().

This type of problem is faced all the time by graphics applications. The
usual approach is just to set a timer on receiving the first event and
ignore all events until the timer fires. It's probably easiest to do this in
the handler itself, although Qt does support global event filtering.

See this thread:
http://lists.trolltech.com/qt-interest/2006-02/thread00129-0.html

A similar approach is to keep track of the event times, but it looks like Qt
does not keep track of times like GTK does.

Michael

On Wed, Jun 15, 2011 at 11:33 PM, Dianne Cook <visnut at gmail.com> wrote:

> Michael,
>
> I keep forgetting to ask you this... Is there any way to get qt to throw
> away events when it gets too many? XWindows, and I think gtk, had a function
> called "flush" which cleared out the event queue periodically. Currently its
> possible to hang cranvas, if you click a button too many times, as wt
> struggles to get through responding to all the events.
>
> cheers,
> Di
>
> ---------------------------
> Di Cook
> visnut at gmail.com
>
>
>
>
> _______________________________________________
> Qtinterfaces-devel mailing list
> Qtinterfaces-devel at lists.r-forge.r-project.org
>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20110616/51366e34/attachment.htm>


More information about the Qtinterfaces-devel mailing list