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

Inconsistent handling of resource filenames

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 4.7.2
    • Core: Resource System
    • None

    Description

      Some Qt classes can only access resource files using a "qrc:/" filename, others only using a ":/" filename.
      Example:
      QString filename1 = "qrc:/examples/myfile.html";
      QWebView webview;
      webview.load(filename1); // OK, loads and displays
      QFileInfo info1(filename1);
      info1.exists(); // returns false

      QString filename2 = ":/examples/myfile.html";
      webview.load(filename2); // ERROR
      QFileInfo info2(filename2);
      info2.exists(); // returns true

      This is really annoying, you never know if you can use a resource with a given file name, depending on which QT class you'll use.

      Probably related:
      QDir(:/").entrylist(); // Lists all resources.
      QFileSystemModel().setRootPath(":/"); // lists windows drive letters!

      Attachments

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

        Activity

          People

            jbornema Joerg Bornemann
            j.neuhaus J N
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes