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

Vector3D type in QML is inconsistent

    XMLWordPrintable

Details

    • deb92c796c727c6ad0eaf28929cda6d000c1b3c1

    Description

      The following example uses Qt.vector3d() on a user-defined property, a standard property, and in a script:

      import Qt 4.7
      
      Rectangle {
          width: 50; height: 50
          property variant propv3: Qt.vector3d(1, 2, 3)
      
          transform: Rotation {
              id: rotateMe
              axis: Qt.vector3d(1, 2, 3)
          }
      
          Component.onCompleted: {
              print("propv3: " + propv3.x + " " + propv3.y + " " + propv3.z);
      
              print("rotv3: " + rotateMe.axis.x + " " + rotateMe.axis.y + " " + rotateMe.axis.z);
      
              var varv3 = Qt.vector3d(1, 2, 3);
              print("varv3: " + varv3.x + " " + varv3.y + " " + varv3.z);
          }
      }
      

      My expectation was that the output should be "1, 2, 3" for all three cases, but instead produces this:

      propv3: 1 2 3
      rotv3: 1 2 3
      varv3: undefined undefined undefined
      

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            rweather Rhys Weatherley (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes