2016-11-08 16:01 GMT+01:00 william.croc...@analog.com <william.croc...@analog.com>: > On 11/08/2016 09:45 AM, Michael Sué wrote: >> >> Hi, >> >>> qApp->processEvents(QEventLoop::ExcludeUserInputEvents,5000); >> >> >> Your processEvents call timeouts after 5 secs, and you wait for 5 secs, at >> least sometimes. How about reducing it to 1 sec >> then, as you think it has nothing to do, anyway, and probably only waiting >> 1 sec (sometimes). >> > > I assume the call has something to do (sync window size and location > requests with the X server), > I just don't think that takes the full 5 seconds. Yet the call blocks for > the full 5 seconds, > SOMETIMES, even though I believe it has run out of events to process. > > This is somewhat of hack in the max time out (5 secs.) > > But, if there *IS* something to do (sync), and I do not give it enough time, > then the new bug will be that my app only restores window size and location > SOMETIMES, because processEvents was not given enough time.
You seem to be misunderstanding what the timeout is. It doesn't say "this function call may take at most 5 seconds", it says "wait at most 5 seconds". If there are events in the event loop the processEvents() function call will dispatch them and return. If there aren't it will wait for some, and if in 5 seconds no event comes it will return. So if as you say you don't believe there is anything to do and there are no events then the 5 seconds wait is to be expected. The time an event is a bit late and it is not dispatched by the time you call that there will be no wait. Cheers, Giulio > > Bill. > > Oh, and I never did apologize that this email > thread has nothing to do with QML or OpenGL. ;-) > > >> Best, Michael. >> >> >> _______________________________________________ >> Interest mailing list >> Interest@qt-project.org >> http://lists.qt-project.org/mailman/listinfo/interest >> >> >> > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest