[Interest] [SOLVED] Re: QGraphicsView viewport touch event on iOS through event filter

maitai maitai at virtual-winds.org
Thu Aug 27 17:50:33 CEST 2015


Thanks Thiago for your reply,

In an ideal world I would not use processEvents at all. But in practice 
I have a QGraphicsScene/View that refuses to update itself when running 
heavy multi-threaded calculations, that may last for more than 5 
minutes. I even dont catch keyPressedEvents in case the user decides to 
cancel the calculations with <esc>. So unfortunately I run processEvents 
from time to time to make sure the calculation progress is shown on the 
view.

Is there a better solution? Would it be better to use flush() or 
sendPostedEvents() instead?

It would be nice to be able to update directly a QGraphicsItem from 
another thread, but QGraphicsScene is not thread-safe so it leads to a 
crash, at least in my experience.

Philippe

Le 27-08-2015 17:36, André Somers a écrit :
> Op 27-8-2015 om 16:21 schreef Jakob Magiera:
>> No exec(), seriously? Could you point me to a place that elaborates on 
>> this? I mean the QDialog doc clearly states
>> 
>>>> The most common way to display a modal dialog is to call its exec() 
>>>> function.<<
>> What gives?
> The docs. Use open instead.
> 
> André
> 
>> 
>> Jakob
>> 
>> -----Ursprüngliche Nachricht-----
>> Von: interest-bounces+jam=ivu.de at qt-project.org 
>> [mailto:interest-bounces+jam=ivu.de at qt-project.org] Im Auftrag von 
>> Thiago Macieira
>> Gesendet: Mittwoch, 26. August 2015 17:17
>> An: interest at qt-project.org
>> Betreff: Re: [Interest] [SOLVED] Re: QGraphicsView viewport touch 
>> event on iOS through event filter
>> 
>> On Wednesday 26 August 2015 10:02:16 maitai wrote:
>>> Conclusion is: never ever call processEvents() from a eventFilter or
>>> similar event() routines
>> Never do that.
>> 
>> And avoid processEvents() and exec() functions anywhere, period. 
>> Nested event
>> loops cause weird event delivery problems because some events get 
>> delivered
>> unexpectedly and you recurse into your event filters and slots.
>> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list