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

QML Coordinate should be a value type, not passed by reference

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.0.0
    • Location
    • None

    Description

      QML Coordinate currently is an object that is passed around as a pointer (reference) in QML, when users will expect it to be a value type as it is in C++. See, for example, the issue with circle centers in mapviewer, where to obtain the expected semantics we had to change:

      circle.center = point
      

      to

      var c = Qt.createComponent("import QtLocation 5.0; Coordinate { } ");
      c.latitude = point.latitude;
      c.longitude = point.longitude;
      circle.center = c;
      

      This is a fairly major API issue, as it violates the user's natural expectations about the semantics of passing around a Coordinate, which looks essentially like plain old data, but is not even close to it in behaviour.

      Attachments

        Issue Links

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

          Activity

            People

              amccarthy Aaron McCarthy
              alewilso Alex Wilson (closed Nokia identity) (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes