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. Project Management : Taking a directory location
Forum Updated to NodeBB v4.3 + New Features

Project Management : Taking a directory location

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 1.5k Views 3 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.
  • A Offline
    A Offline
    Arqam
    wrote on last edited by
    #1

    In IntelliJ we have Edit Configuration inside the Run where we can add key value pairs, which can be used in projects. Mostly used to specify a certain directory folder.

    So in Qt is there any way that we can specify something like this in the Qt IDE (build setting or something) and then access it through our code?

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

      Hi
      Its a bit unclear what you want.

      But yes, you can add to the .pro file and read in the app.

      like i do
      DEFINES+=PROJECT_LOCATION="$$shell_path($$PRO_FILE_PWD)"

      so i know where the project folder is and read the gfx from there so i dont have to
      copy all to build folder.

      then in .cpp i do
      const char* ProducerLocation = STR(PROJECT_LOCATION);

      so yes u can make defines and use.

      A 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        Its a bit unclear what you want.

        But yes, you can add to the .pro file and read in the app.

        like i do
        DEFINES+=PROJECT_LOCATION="$$shell_path($$PRO_FILE_PWD)"

        so i know where the project folder is and read the gfx from there so i dont have to
        copy all to build folder.

        then in .cpp i do
        const char* ProducerLocation = STR(PROJECT_LOCATION);

        so yes u can make defines and use.

        A Offline
        A Offline
        Arqam
        wrote on last edited by
        #3

        @mrjj said in Project Management : Taking a directory location:

        PRO_FILE_PWD

        Hi, Thanks for the answer.

        What I basically want is there is a folder (let's call dummyFolder) used in the project to save the output files, that is there in everyone's system.
        But the dummyFolder location is different for different people but we need this dummyFolder path in the project.

        So if there is a way where anyone can modify it in some setting of the project instead of changing the path in the code.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          karlheinzreichel
          wrote on last edited by
          #4

          Why not reading the command line of the app,
          of if not possible read the Environment-Variables of the system
          to find the location of dummyFolder ?

          regards
          Karl-Heinz

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

            Hi,

            From your example it sounds like you should rather use QStandardPaths.

            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
            • P Offline
              P Offline
              patrik08
              wrote on last edited by patrik08
              #6

              Hi is this the dummy folder?

              MOC_DIR = build
              RCC_DIR = build
              OBJECTS_DIR = build

              for me is this the a dir resrved to compiler.. :-)
              the most important to me is the bash_profie. file..
              like so..
              https://gist.github.com/natelandau/10654137

              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