+ 2

pyQt5 Error

QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 i have made a progress bar and i'm trying to add a setProperty value to the bar. While i'm doing this it's throuing this error. Can anyone tell me why pyqt5 giving such errors.

9th May 2022, 12:56 PM
Anjali Singh
Anjali Singh - avatar
4 Respostas
+ 1
Add a code snippet and copy and paste the error info. Make sure to mark the line that the error appears on.
9th May 2022, 1:22 PM
Slick
Slick - avatar
0
@Slick this is my function while calling this function when the percentage value is set to the progress bar it giving this error def voltage_callback(self, object,attr_name, value): print("number of cells : ", self.n) value = dronekit_action.vehicle.battery.voltage print("voltage: ", value) min_voltage = self.n * 3.3 max_voltage = self.n * 4.2 steps = self.n * 0.009 perc = 0 voltage = round(value,1) print("optimize voltage: ", voltage) if voltage <= min_voltage: perc = 0 elif voltage>min_voltage and voltage<=18: diff = round((voltage - min_voltage),1) perc = int(str(diff//steps).split(".")[0]) self.ui.label_5.setText((str(round(value,2))) +"v") ---> here, this line is througing the error -------------------------------------------------------------- self.ui.progress_bar.setProperty("value", perc) ------------------------------------------------------------ ------- error --- QWidget::repaint: Recursive repaint detected QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
10th May 2022, 5:10 AM
Anjali Singh
Anjali Singh - avatar
0
Slick once look at the problem
10th May 2022, 5:28 AM
Anjali Singh
Anjali Singh - avatar
0
this app cant run guis. Use pydroid
10th May 2022, 4:00 PM
underscore
underscore - avatar