Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
What is the difference between qrc:/ and qrc:///
nejatafshar last edited by nejatafshar
When loading main qml the root QML file, one can use
qrc:///as the url scheme:
Both approaches work but it seems that
qrc:///is the recommended approach. So what's the difference between the two?
So what's the difference between the two?
The second one is a valid url while the first is not. The first one only works because the QString passed to the QUrl is parsed in tolerant mode: https://doc.qt.io/qt-5/qurl.html#QUrl-2
nejatafshar last edited by
@Christian-Ehrlicher Thanks. The first one is more concise and I regularly use it where ever I want to address a resource item. So which one is recommended? Is there any circumstances that the first one fails?
ODБOï last edited by
So which one is recommended
the valid one.
Is there any circumstances that the first one fails?
yes as @Christian-Ehrlicher said,
most likely it will fail if QUrl::ParsingMode is set to QUrl::StrictMode