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

Can no longer assign properties to rect in QML

    XMLWordPrintable

Details

    • db9be0a9d6195bc52415ce28d605ace149d02782

    Description

      In Qt 5.4, and Qt 5.5, the behavior of this is different:

      import QtQuick 2.3
      
      Rectangle {
          id: root
          width: 100
          height: 40
      
          Component.onCompleted: {
              var result = root.mapToItem(null, 2, 2, 4, 4);
              result.left = result.x
              result.right = result.x + result.width
              console.log(result, JSON.stringify(result));
              console.log(result.left, result.right)
          }
      }
      

      Qt 5.4:

      qml: [object Object] {"x":2,"y":2,"width":4,"height":4,"left":2,"right":6}
      qml: 2 6
      

      Qt 5.5:

      qml: QRectF(2, 2, 4, 4) {}
      qml: undefined undefined
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            ske Steve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes