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. Ressource - Setting a directory as a resource?
QtWS25 Last Chance

Ressource - Setting a directory as a resource?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 709 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.
  • M Offline
    M Offline
    maximus
    wrote on last edited by
    #1

    Hi,

    I would like to know if it's possible to bind a directory to a resource like you can with files.

    For example, I have a bunch of xml inside a folder that I would like to deploy with my software.
    Best thing for me would be to set the folder as the resource and then use Qt to iterate through the files inside the folder. I want to use resource because I would like to hide the files from the installation directory (what i'm doing now)
    Thanks!


    Free Indoor Cycling Software - https://maximumtrainer.com

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

      Hi,

      AFAIK, no, you have to select the complete content of the directory and add it to your qrc file

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

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kuschky
        wrote on last edited by
        #3

        Take look to QResource

        if you place a directory with your xml files inside the Resource file you can query the Resource system for this directory and you will get the list of files it contains.

        @
        QStringList QResource::children()
        @

        This List of filenames you can use to open it with QFile and an url similar this one:
        @
        qrc:/somedir/some.xml file descriptor
        @

        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