Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Correct syntax for qrc and file URI prefix?
QtWS25 Last Chance

Correct syntax for qrc and file URI prefix?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 356 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SPlatten
    wrote on 4 May 2020, 10:25 last edited by SPlatten 5 Apr 2020, 10:26
    #1

    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.

    Kind Regards,
    Sy

    J 1 Reply Last reply 4 May 2020, 10:29
    0
    • S SPlatten
      4 May 2020, 10:25

      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.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 4 May 2020, 10:29 last edited by
      #2

      @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);
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      1/2

      4 May 2020, 10:25

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved