I am writing a small application in Qt (with PySide in Python), which makes extensive use of QGraphicsView and displays animations (sort of). There are a few buttons to start/stop/pause and a few other widgets.
At first, I thought I should use QThread to handle the graphics and send signals to the main thread to QGraphicsScene etc., so I began implementing it. It worked, but I was not very satisfied with it - I tried a few different ways, but I think I overcomplicated it too much and the signal/slot mechanism and locking QMutexes was not even that fast.
Then (I am new to PySide), I found the processEvents()
method in the docs. I tried implementing it and it works just the way I want, it's fast and simple.
Right now I am using it and everything is done on the main thread, and the GUI is responsive.
My questions are: Is it wrong to use that method in that way? Should I just stick to QThreads?
These questions are related to these...
How to make Qt work when main thread is busy?
Should I use QCoreApplication::processEvents() or QApplication::processEvents()?
... where others say it should not be used.