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 qrc resource file path?
Qt 6.11 is out! See what's new in the release blog

Correct qrc resource file path?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 981 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.
  • C Offline
    C Offline
    Calicoder
    wrote on last edited by
    #1

    Hello fellow QT'ers, wondering if you folks have an suggestions for how to handle this:
    I have an app with an app.qrc file as follows:

    C:\apps\VisualApp\app.qrc
    resources/img/background.png
    Resource URL: :/resources/img/background.png
    

    I saved a file background.png under the folder C:\apps\VisualApp\img
    How can I add this background.png file in a text file? Is it as simple as using the full filepath C:\apps\VisualApp\img\background.png or can I use the Resource URL somehow?

    Thanks again

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by adding that image it to a text file ?

      A text file is usually just a bunch of characters.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        What do you mean by adding that image it to a text file ?

        A text file is usually just a bunch of characters.

        C Offline
        C Offline
        Calicoder
        wrote on last edited by
        #3

        @SGaist Sorry I meant like a settings file app.ini. If I set up a background key and value, can I use the QRC resource url as the value or is it better to use the full path to the png file?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          No problem with using the ressource path. You might want to consider using aliases with your resources.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          C 1 Reply Last reply
          1
          • SGaistS SGaist

            No problem with using the ressource path. You might want to consider using aliases with your resources.

            C Offline
            C Offline
            Calicoder
            wrote on last edited by
            #5

            @SGaist I'll read up on using aliases.

            Thank you for the help.

            1 Reply Last reply
            0

            • Login

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