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

Doc: Make Qt.resolvedUrl() more visible

    XMLWordPrintable

Details

    Description

      Qt.resolvedUrl() has become important in Qt 6: https://doc.qt.io/qt-6/qml-changes-qt6.html#url-resolution

      However, there are very few examples of it being used: https://www.google.com/search?q=site:doc.qt.io/qt-6/+"resolvedurl"

       

      Suggestion

      Use Qt.resolvedUrl() in more places where it makes sense, so that users see them in action more often.

       

      Example

      One candidate is https://doc.qt.io/qt-6/qml-qt-labs-platform-systemtrayicon.html which currently uses absolute paths for icon.source

      Reasons for candidacy:

      • We want to encourage users to keep *.qml files and their assets as resources within the same QML module, and use relative paths
      • However, SystemTrayIcon.icon.source will fail to load a relative path that's not processed by Qt.resolvedUrl()

       
      (Simple test code for SystemTrayIcon at QTBUG-118844)

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes