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. Mac OSX folders needed by application
Forum Updated to NodeBB v4.3 + New Features

Mac OSX folders needed by application

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 1.6k Views 2 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.
  • N Offline
    N Offline
    Nevering
    wrote on last edited by
    #1

    What is the best way to reference and use folders on a Mac in Qt ? I'm finding that the ApplicationDirPath is coming back with some extra folders in the path name which is messing up finding associated folders relative to Windows and Linux .

    thanks

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JosephMills
      wrote on last edited by
      #2

      I have dealt with this in the past . Because of osx bundle madness. I wrote a helper function that just uses QString and cuts off the bundle madness. Alternatively if you are asking about system wide paths take a look at QStanderedPaths .

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Nevering
        wrote on last edited by
        #3

        I have an application and some associated files. First I was just putting them an folder , app and associated folders. On windows it is easy to reference these folders based on the location of the application . On Mac I get an extra mess for the application path. Could you share your helper function ideas ? This seems like something that should be standard in Qt, if it's going to be truly Cross Platform.

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

          Hi,

          What folders do you have in mind ?
          Where are you putting them ?
          What is your use of them ?

          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
          • N Offline
            N Offline
            Nevering
            wrote on last edited by
            #5

            Right now I'm just building, and the application couldn't fine the folders

            Have a
            Bin folder with application
            Menu folder that builds a dynamic menu
            Des folder that has some information
            Image that has images to display

            I added CONFIG -= app_bundle to .pro file and now running the app finds the folders..

            I guess I could have a predefined folder for Mac and Windows somewhere

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

              Where are you storing them on Windows and Linux ?

              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
              • N Offline
                N Offline
                Nevering
                wrote on last edited by
                #7

                On Windows and Linux it's the same folder as application ..

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

                  Image and Des folder looks like static content, right ?
                  What about Menu ? Is it something your user can modify ?

                  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
                  • N Offline
                    N Offline
                    Nevering
                    wrote on last edited by
                    #9

                    Right image and des is static content, but would likely be changed with minor updates.

                    One menu is built from menu files. This will probably go into a dialog for selection rather than menu.
                    One of the menus the user can customize.

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

                      Then regardless of the OS, you should put that user customizable subfolder in the QStandardPaths::AppConfigLocation.

                      The other folders content will be updated when you provide a new version of the application.

                      In any case, don't put anything user editable in the same folder as the binary. On Windows, the folder is read-only, and it should be the same on Linux.

                      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
                      • N Offline
                        N Offline
                        Nevering
                        wrote on last edited by
                        #11

                        Thanks, I'll try that

                        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