Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. my project crash with this error:Could not parse stylesheet of object QFrame(0x3e7b620)
Forum Updated to NodeBB v4.3 + New Features

my project crash with this error:Could not parse stylesheet of object QFrame(0x3e7b620)

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 2 Posters 984 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    faezehFrj
    wrote on last edited by faezehFrj
    #1

    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

    eyllanescE 1 Reply Last reply
    0
    • F faezehFrj

      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

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @faezehFrj what is the output of: print(styleSheetNew)?

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        faezehFrj
        wrote on last edited by faezehFrj
        #3

        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));
        
        eyllanescE 1 Reply Last reply
        0
        • F faezehFrj

          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));
          
          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by
          #4

          @faezehFrj I don't get an error for that qss, do you get an error for that case?

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          F 1 Reply Last reply
          0
          • eyllanescE eyllanesc

            @faezehFrj I don't get an error for that qss, do you get an error for that case?

            F Offline
            F Offline
            faezehFrj
            wrote on last edited by
            #5

            @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)

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved