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. Shipping configuration files with Foo.app
Qt 6.11 is out! See what's new in the release blog

Shipping configuration files with Foo.app

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.1k 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.
  • J Offline
    J Offline
    JP Larson
    wrote on last edited by
    #1

    I have some configuration files I want to package into my Foo.app. (I'm currently strictly developing on Mac Desktop). I've tried a few things and done some searching, but the solution is eluding me.

    I tried just adding the files to the project. They aren't moved into the ../build-Foo* directories.

    I made my .json files part of the Resources list by editing the .pro, but that didn't do anything -- not even change how they display in the navigator inside Qt Creator.

    Is there an automatic way to do this? For now, I'm copying with a little script.

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

      Hi and welcome to devnet,

      If you have put your files in Qt's resources system, they are built in your application.

      What kind of configuration file are you using ?
      How will they be used by your application ?

      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
      1
      • J Offline
        J Offline
        JP Larson
        wrote on last edited by
        #3

        It's a desktop Widget GUI app.

        The files contain JSON and define some extensive default behavior for a process engine. I'm building a Beat Saber map editor for Mac that works on the concept of patterns.

        For instance, one pattern is a simple down stroke of a blue cube. Another pattern is the same thing for a red cube. Up strokes of each are two more patterns. Those are easy. But then we can do down-up. Or we can do a sort of swirl combo of down, up-left, up, and then we can repeat that pattern 3 or 4 times fairly quickly. You end up twirling the saber in circles. It's kind of fun, once you recognize the pattern. The first time I hit it, I flailed hard.

        And then we can do that 3 times on blue, and 3 times on red.

        Rather than manually laying out each cube, I'm designing patterns, and the program can insert the entire pattern for me. And I'm going to see how well I can get it to generate an entire map from a single click. We'll see if I'm clever enough for that algorithm to work well.

        The JSON files define the well-known patterns I might use a lot.

        Once I'm satisfied, I'll open-source the project on github and maybe someone will do the work to make it build on Windows, too. I don't have any Windows in the house to test against, so for now I'm staying Mac-centric.

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then why not put the json into a resource file like @SGaist proposed?

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          J 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            Then why not put the json into a resource file like @SGaist proposed?

            J Offline
            J Offline
            JP Larson
            wrote on last edited by
            #5

            @Christian-Ehrlicher said in Shipping configuration files with Foo.app:

            Then why not put the json into a resource file like @SGaist proposed?

            I wasn't sure how to accomplish that, and ultimately it's going to be quite a bit of JSON. However, I stumbled across a solution. In my Foo.pro file:

            myPatterns.files = $$PWD/Patterns
            myPatterns.path = Contents/Resources
            QMAKE_BUNDLE_DATA += myPatterns

            I got that from this:

            https://www.ics.com/blog/your-guide-deploying-qt-applications-macos

            It may be that putting it into a resource file would have been the proper choice. I'm still a bit of a Qt newbie. The only thing I've used resources files for so far are icons.

            I like the solution I stumbled on, but maybe it's not a good solution. For now, it's working.

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

              No problem with that solution, it's the proper way to ship resources especially if they are big.

              Will these files be changed somehow or are they meant to be read-only ?

              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
              1

              • Login

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