Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Could not parse stylesheet of object 0x1018c1d50
Forum Updated to NodeBB v4.3 + New Features

Could not parse stylesheet of object 0x1018c1d50

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 3.2k Views 1 Watching
  • 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    I have an instance of QFrame, here is my xml configuration for the frame:

    <frame id="frm1" x="10%" y="10%" width="80%" height="80%"
           properties="QFrame {background-color: #e9efef;
                               background-image: url('meshtile_4x4.png');
    			   border: 2px solid #cccccc;
    			   border-top-left-radius: 8px;
    			   border-top-right-radius: 8px;
    			   border-bottom-left-radius: 8px;
    			   border-bottom-right-radius: 8px;}">
        <button id="btn1" x="2%" y="2%" width="50%" height="50%"
                properties="QPushButton {background-color: #4cb9b3;
    			 	     border: 1px solid #3faca6;
    			  	     border-top-left-radius: 0px;
    				     border-top-right-radius: 8px;
    				     border-bottom-left-radius: 8px;
    				     border-bottom-right-radius: 8px;
    				     color: #ffffff;
    			     	     padding: 1px 18px 1px 3px;
    		        	     min-width: 6em}"
                shadow="3 3 8 #77000000" checkable="true">						
            <state value="off" text="Off"/>
            <state value="on" text="On"/>				
            <signal name="pbtnClicked">
                <subscriber sid="win1:title" script="simon2.js@clicked"/>
            </signal>	
        </button>
        <button id="btn2" x="60%" y="2%" width="10%" height="50%"
                properties="QPushButton {background-color: #4cb9b3;
    			 	     border: 1px solid #3faca6;
    			  	     border-top-left-radius: 0px;
    				     border-top-right-radius: 8px;
    				     border-bottom-left-radius: 8px;
    				     border-bottom-right-radius: 8px;
    				     color: #ffffff;
    			     	     padding: 1px 18px 1px 3px;
    		        	     min-width: 6em}"
                shadow="3 3 8 #77000000" checkable="true">						
            <state value="off" text="Off"/>
            <state value="on" text="On"/>				
            <signal name="pbtnClicked">
                <subscriber sid="win1:title" script="simon2.js@clicked"/>
            </signal>	
        </button>
    </frame>
    

    My application reads the XML and creates a QFrame for the frame node and a QPushButton for each button node. As the engine renders the XML as its read the QFrame is created initially with no content then as the button nodes are read these are added as children of the QFrame.

    When the first button is read and added to the QFrame the parent widget "show" function is called, this is when I get the message:

    Could not parse stylesheet of object 0x1018c1d50
    

    The address is not constant I've just posted it here for completeness. What does this message mean?

    Kind Regards,
    Sy

    JonBJ 1 Reply Last reply
    0
    • SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #8

      @JonB , found it missing ";" on the last statement before the "}"

      Kind Regards,
      Sy

      1 Reply Last reply
      0
      • SPlattenS SPlatten

        I have an instance of QFrame, here is my xml configuration for the frame:

        <frame id="frm1" x="10%" y="10%" width="80%" height="80%"
               properties="QFrame {background-color: #e9efef;
                                   background-image: url('meshtile_4x4.png');
        			   border: 2px solid #cccccc;
        			   border-top-left-radius: 8px;
        			   border-top-right-radius: 8px;
        			   border-bottom-left-radius: 8px;
        			   border-bottom-right-radius: 8px;}">
            <button id="btn1" x="2%" y="2%" width="50%" height="50%"
                    properties="QPushButton {background-color: #4cb9b3;
        			 	     border: 1px solid #3faca6;
        			  	     border-top-left-radius: 0px;
        				     border-top-right-radius: 8px;
        				     border-bottom-left-radius: 8px;
        				     border-bottom-right-radius: 8px;
        				     color: #ffffff;
        			     	     padding: 1px 18px 1px 3px;
        		        	     min-width: 6em}"
                    shadow="3 3 8 #77000000" checkable="true">						
                <state value="off" text="Off"/>
                <state value="on" text="On"/>				
                <signal name="pbtnClicked">
                    <subscriber sid="win1:title" script="simon2.js@clicked"/>
                </signal>	
            </button>
            <button id="btn2" x="60%" y="2%" width="10%" height="50%"
                    properties="QPushButton {background-color: #4cb9b3;
        			 	     border: 1px solid #3faca6;
        			  	     border-top-left-radius: 0px;
        				     border-top-right-radius: 8px;
        				     border-bottom-left-radius: 8px;
        				     border-bottom-right-radius: 8px;
        				     color: #ffffff;
        			     	     padding: 1px 18px 1px 3px;
        		        	     min-width: 6em}"
                    shadow="3 3 8 #77000000" checkable="true">						
                <state value="off" text="Off"/>
                <state value="on" text="On"/>				
                <signal name="pbtnClicked">
                    <subscriber sid="win1:title" script="simon2.js@clicked"/>
                </signal>	
            </button>
        </frame>
        

        My application reads the XML and creates a QFrame for the frame node and a QPushButton for each button node. As the engine renders the XML as its read the QFrame is created initially with no content then as the button nodes are read these are added as children of the QFrame.

        When the first button is read and added to the QFrame the parent widget "show" function is called, this is when I get the message:

        Could not parse stylesheet of object 0x1018c1d50
        

        The address is not constant I've just posted it here for completeness. What does this message mean?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #2

        @SPlatten
        You are reading that properties="QPushButton {... in your XML code, and creating a QPushButton, and setting its stylesheet to that CSS? So if you do something wrong in reading that from the XML and setting it as stylesheet on the button, the message might indicate the CSS is incorrect?

        1 Reply Last reply
        0
        • SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by SPlatten
          #3

          The thing is the button renders exactly how I would expect and as far as I can see the CSS is perfect. I read the properties attribute and apply the content using setStyleSheet.

          Kind Regards,
          Sy

          JonBJ 1 Reply Last reply
          0
          • SPlattenS SPlatten

            The thing is the button renders exactly how I would expect and as far as I can see the CSS is perfect. I read the properties attribute and apply the content using setStyleSheet.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #4

            @SPlatten
            Step through your code in the debugger. Watch for exactly when that message appears in the output window. EDIT OK, I see you just get it at .show() time. Well at least look at the widget's styleSheet() just before you show it, don't assume it's OK, examine it for any slips.

            Reduce the style you're setting down to one line, see what happens. Get rid of the properties completely.

            Check that the object address does appear to be that of the button you're creating.

            Usual debugging techniques....

            1 Reply Last reply
            0
            • SPlattenS Offline
              SPlattenS Offline
              SPlatten
              wrote on last edited by
              #5

              The interesting thing is the message is only displayed when the QFrame widget "show" function is called.

              Kind Regards,
              Sy

              JonBJ 1 Reply Last reply
              0
              • SPlattenS SPlatten

                The interesting thing is the message is only displayed when the QFrame widget "show" function is called.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #6

                @SPlatten
                That will be because the stylesheet probably doesn't have to be parsed/applied till show-time.

                1 Reply Last reply
                0
                • SPlattenS Offline
                  SPlattenS Offline
                  SPlatten
                  wrote on last edited by
                  #7

                  @JonB , the address does correspond to the button widget. I will reduce the CSS and see what happens.

                  Kind Regards,
                  Sy

                  1 Reply Last reply
                  0
                  • SPlattenS Offline
                    SPlattenS Offline
                    SPlatten
                    wrote on last edited by
                    #8

                    @JonB , found it missing ";" on the last statement before the "}"

                    Kind Regards,
                    Sy

                    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