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

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

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • P3: Somewhat important
    • Resolution: Invalid
    • 5.15.2, 6.1.2
    • None
    • 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

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

          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