[RQt-devel] issue with getting too many events

Yihui Xie xieyihui at gmail.com
Thu Jun 16 20:44:51 CEST 2011


I have been thinking of putting a little global "timer" in the
callbacks -- if the time difference between the new event and the last
event is less than, say, 0.05 seconds, the event is simply discarded.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Thu, Jun 16, 2011 at 8:49 AM, Michael Lawrence
<lawrence.michael at gene.com> wrote:
> 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
>
>
> _______________________________________________
> 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
>
>


More information about the Qtinterfaces-devel mailing list