I use PyQt to show the detection result. I have two threads one Ui_MainWindow ui and one QThread detect. I got the detect result(a float number) and want to use the ui.QProgressBar.setValue(result) in the detect.run but it would cause error sometimes.
The error is
QPainter::begin: A paint device can only be painted by one painter at a time.
QPainter::setCompositionMode: Painter not active
I searched this question and found I can not use setValue outside a GUI thread. And some answers say a signal and slot should be used to do this. Any one tell me how to write the code