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

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2, 6.1.2
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • Platform/s:
      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

              Assignee:
              docteam Qt Documentation Team
              Reporter:
              ratijas ivan tkachenko
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes