my project crash with this error:Could not parse stylesheet of object QFrame(0x3e7b620)
-
I use pyqt5 in my project and want to have a Circular Progress Bar in it.
I use this video Modern GUI - Python, Qt Designer and PySide2 - Circular Progress Bar/Preloader .it works currently but when I send data every second for this method throw mqtt, it crashed and this error disappear ":Could not parse stylesheet of object QFrame(0x3e7b620)" then the project is closed.
my code is:def tempratureBarValue(self, value): styleSheet = """ border-radius:90px; background-color: qconicalgradient(cx:0.5, cy:0.5, angle:90, stop: {stop_1} rgba(255, 85, 255, 0), stop: {stop_2} rgba(253, 54, 11, 80)); """ progress = (100 - value) / 100.0 # get new value stop_1 = str(progress - 0.001) stop_2 = str(progress) # replace styleSheetNew = styleSheet.replace("{stop_1}", stop_1).replace("{stop_2}", stop_2) # set new stylesheet self.ui.label_temperature.setText(QCoreApplication.translate("MainWindow", str(value), None)) self.ui.circularProgressT.setStyleSheet(styleSheetNew)I don't know what am I doing :l
-
I use pyqt5 in my project and want to have a Circular Progress Bar in it.
I use this video Modern GUI - Python, Qt Designer and PySide2 - Circular Progress Bar/Preloader .it works currently but when I send data every second for this method throw mqtt, it crashed and this error disappear ":Could not parse stylesheet of object QFrame(0x3e7b620)" then the project is closed.
my code is:def tempratureBarValue(self, value): styleSheet = """ border-radius:90px; background-color: qconicalgradient(cx:0.5, cy:0.5, angle:90, stop: {stop_1} rgba(255, 85, 255, 0), stop: {stop_2} rgba(253, 54, 11, 80)); """ progress = (100 - value) / 100.0 # get new value stop_1 = str(progress - 0.001) stop_2 = str(progress) # replace styleSheetNew = styleSheet.replace("{stop_1}", stop_1).replace("{stop_2}", stop_2) # set new stylesheet self.ui.label_temperature.setText(QCoreApplication.translate("MainWindow", str(value), None)) self.ui.circularProgressT.setStyleSheet(styleSheetNew)I don't know what am I doing :l
@faezehFrj what is the output of:
print(styleSheetNew)? -
when I sent value 28 then I receive :
border-radius:90px; background-color: qconicalgradient(cx:0.5, cy:0.5, angle:90, stop:0.169 rgba(255, 85, 255, 0), stop:0.17 rgba(115, 161, 206, 255));@faezehFrj I don't get an error for that qss, do you get an error for that case?
-
@faezehFrj I don't get an error for that qss, do you get an error for that case?
@eyllanesc
It works perfectly after 10 times or more than, It crashed. If I send every second one topic for it.
I receive this error:
Could not parse stylesheet of object QFrame(0x3e7b620)