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. Is it possible to define two different Resourcefiles, or can only be one current Resource File

Is it possible to define two different Resourcefiles, or can only be one current Resource File

Scheduled Pinned Locked Moved General and Desktop
5 Posts 1 Posters 2.0k 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.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    Hi,
    I'm using Qt5 and want to load Data from Resourcefiles.
    Is it possible to define two different Resourcefiles, or can only be one current Resource File?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      It is possible to define numerous QRCs. Just be sure to avoid file name clashes.

      (Z(:^

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #3

        But how can i use the different Files?

        For Example in QML:
        @
        Image{
        id: pic
        x: 0
        y: 0
        z: 0
        source: "qrc:/nameofalias"
        }
        @

        That does only use the resource wich is on the top of the list in .pro file.

        But i tried with prefix in the different qrc files, then it works.

        Example:
        @
        source: "qrc:/prefixofsourcetwo/nameofalias"
        @

        Is this the right way, or is it also possible to set source for example:
        @
        source: "resourcefilename:/nameofalias"
        @

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I'm not sure I understand your problem. You should use prefixes. Different QRC files can use the same prefixes, too.

          (Z(:^

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            Okay, I now use prefixes and it works perfect.

            Thank you for your help.

            Solved.

            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