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

QUrls passed from C++ to QML seem to be compared by reference instead of value

    XMLWordPrintable

Details

    Description

      Comparing urls in QML when assigned to a property:

      property url myUrl0: "http:///blabla"
      property url myUrl1: "http:///blabla" 

      like so:

      root.myUrl0 === root.myUrl1 

      would evaluate as "true" (=> comparison by value?)

      When a QUrl is passed from C++ to QML, it should be automatically converted into a url but those urls have very different behavior in comparisons. They look more like they are being compared by reference since almost any other comparison than "url_passed_from_cpp === url_passed_from_cpp" evaluates to false.

      Steps to reproduce the issue:

      1. Run the attached project
      2. Click "push to emit"
      3. observe application output

      Attachments

        1. QTBUG-138545.zip
          3 kB
          Miika Pernu
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            miikapernu Miika Pernu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes