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

QML property with 'url' type resolves incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 6.0.0 RC
    • None
    • 0a1e4cc7ec7548f6273befff9cdddb0bc7a58961

    Description

      If we declare 'url' property in QML file '/home/root/main.qml' like this:
      ...
      property url imageFolder: "./Images"
      ...
      And then print it out, in Qt5 we got:
      "file:///home/root/Images"
      but on Qt6 we got:
      "./Images"
      This cause problem if we try use 'imageFolder' later in QML file which located in other folder,  for example in file '/home/root/foo/Foo.qml' we write:
      ....
      Image { source: imageFolder + "/my.png" }
      ....
      There we expect path "/home/root/Images/my.png", but in Qt6 got "/home/root/foo/Images/my.png"

      In General: Behavior or QVariant(QUrl) changed and cause runtime errors

      I suspect type conversion code (qvariant/qmetatype), but not sure for 100% and keep investigation going on

       

       

      Attachments

        Issue Links

          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
              roman_genkhel Roman Genhel
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes