Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-14962

Strange and inconsistent behavior for grouped properties

XMLWordPrintable

      Run the code below. Note that it works as expected.

      1) Comment in the //1 line and run again. Note how it is never called. Defect?
      2) Comment in the //2 line and run again. This results in: Cannot assign to non-existent property "onPixelSizeChanged"
      3) Change the //3 line to "font: {" and run again. Note how the onPixelSizeChanged is called, but the pixelSize is not set and an error is printed: Unable to assign [undefined] to QFont font

      import Qt 4.7
      
      Rectangle {
          width: 800
          height: 480
      
          TextInput {
              id: textInput
              anchors {
                  fill: parent
                  margins: 100
      //1            onMarginsChanged: print("Margins changed: " + anchors.margins)
              }
      
              font {   //3
                  pixelSize: 20
      //2            onPixelSizeChanged: print("Font size changed: " + font.pixelSize)
              }
      
              text: "Hello world!"
          }
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            aakenned Aaron Kennedy
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes