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?
Forum Updated to NodeBB v4.3 + New Features

Correct syntax for qrc and file URI prefix?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 377 Views 1 Watching
  • 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by SPlatten
    #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

    jsulmJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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

      • Login

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