Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
4.7.2
-
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!