Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Ressource - Setting a directory as a resource?

    General and Desktop
    3
    3
    573
    Loading More Posts
    • 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
      maximus last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • K
          kuschky last edited by

          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 Reply Quote 0
          • First post
            Last post