Correct syntax for qrc and file URI prefix?
-
wrote on 4 May 2020, 10:25 last edited by SPlatten 5 Apr 2020, 10:26
What is the correct syntax for qrc and file URI prefixes?
I know that a URI prefix for HTTP is normally "http://" and for HTTPS "https://"
In the application I'm working on qrc is prefixed with "qrc:/", single slash, files are prefixed with "file:///".
Are these both correct, notice that the file prefix has 3 slashes.
https://en.wikipedia.org/wiki/File_URI_scheme
States that three slashes is correct and two isn't.
-
What is the correct syntax for qrc and file URI prefixes?
I know that a URI prefix for HTTP is normally "http://" and for HTTPS "https://"
In the application I'm working on qrc is prefixed with "qrc:/", single slash, files are prefixed with "file:///".
Are these both correct, notice that the file prefix has 3 slashes.
https://en.wikipedia.org/wiki/File_URI_scheme
States that three slashes is correct and two isn't.
@SPlatten Like shown here: https://doc.qt.io/qt-5/resources.html
cutAct = new QAction(QIcon(":/images/cut.png"), tr("Cu&t"), this);
or
cutAct = new QAction(QIcon("qrc:///images/cut.png"), tr("Cu&t"), this);
1/2