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

QFile does not support "qrc:/..." URLs?

    XMLWordPrintable

Details

    • Task
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.15.2, 6.1.2
    • Core: I/O
    • None
    • All

    Description

      After calling this function:

      QSGMaterialShader::setShaderSourceFile (qsgmaterialshader.cpp:313)

      some time later this call chain occurs:

      QSGMaterialShaderPrivate::loadShaderSource (qsgmaterialshader.cpp:54)
      QSGShaderSourceBuilder::appendSourceFile (qsgshadersourcebuilder.cpp:244)
      QFile::open (qfile.cpp:893)
      QFilePrivate::engine (qfile.cpp:110)
      QAbstractFileEngine::create (qabstractfileengine.cpp:204)
      QFileSystemEngine::resolveEntryAndCreateLegacyEngine (qfilesystemengine.cpp:191)
      _q_resolveEntryAndCreateLegacyEngine_recursive (qfilesystemengine.cpp:135)

      Which leads to this error message:

      Failed to find shader "qrc:/scenegraph/graph/shaders/noisy.vsh"
      Failed to find shader "qrc:/scenegraph/graph/shaders/noisy.fsh"

      There is something going on which does not take "qrc:" prefix into account.

      if (ch == QLatin1Char(':')) {
      if (prefixSeparator == 0)

      Unknown macro: { engine = new QResourceFileEngine(filePath); return _q_checkEntry(engine, resolvingEntry); }

      As far as I get it, QResourceFileEngine will be created only for paths starting with ":" because of prefixSeparator == 0 check.

      I really wonder, how other things like QML imports and resolved URLs work, while this one doesn't.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-94977
          # Subject Branch Project Status CR V

          Activity

            People

              thiago Thiago Macieira
              ratijas ivan tkachenko
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes