I have a project which has multiple threads. Each thread has a “worker class” which updates a single progress bar located in the main thread (MainWindow).
The progress bar’s pointer is passed to the “worker class” at at the time it was instantiated. I didn’t subclass QThread but instead, I used QObject::moveToThread() to pass the worker class to a thread.
QThread1 ---> QProgressBar1
QThread2 ---> QProgressBar2
QThread3 ---> QProgressBar3
....
when there are multiple threads/worker class created, “QWidget::repaint: Recursive repaint detected” error comes out.
I am thinking that it was caused by passing the pointer of the progress bar to another thread.
What is the solution for this? Thanks
↧