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

Using files from qrc in QML under windows/android

    XMLWordPrintable

Details

    • Android, Windows

    Description

      Working on a qml application for Android under Windows 10 64 bit. 

      I stored an image file in qrc file and checked the documentation for the proper reference to be used in qml. I stumbled over a couple of notations starting with and without '/'. Also in some apparently non-Qt-insider tutorial II could not find a solution. 

      Finally I started this thread https://forum.qt.io/topic/100893/displaying-an-image-in-qml and got diverse responses. The working solution for my problem is that I need to use the prefix "qrc:///" and the file is found and included (see also thread). 

      After I knew this I could also find some reference in https://doc.qt.io/qt-5/resources.html , but that is very easy overlooked. I have checked a couple of official Qt examples for QML for instance https://doc.qt.io/qt-5/qtquick-imageelements-example.html . The code does not show the prefix either. 

      Therefore, there should be a reference included of what the proper way working on all OS is and it would be good also if the documentation and example are going to be showing this "official" notation. 

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            koahnig Ko Ahnig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes