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. QT Applicationpath and Debug folder

QT Applicationpath and Debug folder

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 308 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.
  • P Offline
    P Offline
    pixbyte
    wrote on 1 May 2021, 19:56 last edited by pixbyte 5 Jan 2021, 20:01
    #1

    In my project I use a subfolder Plugins. I try to access this folder in Debug mode but QT is not able to find this path.
    The problem is the folder is not part of the build folder. Exact this build folder is given back from "QCoreApplication::applicationDirPath()".
    Is there a way to tell QTCreator to use the project folder like itself is doing with linking libraries?
    To copy always the "Plugins" folder to the Debug folder is an unwanted hack.
    I think in all I need the same path as the projectfile $$PWD
    Any solution`?

    A 1 Reply Last reply 2 May 2021, 02:44
    0
    • P pixbyte
      1 May 2021, 19:56

      In my project I use a subfolder Plugins. I try to access this folder in Debug mode but QT is not able to find this path.
      The problem is the folder is not part of the build folder. Exact this build folder is given back from "QCoreApplication::applicationDirPath()".
      Is there a way to tell QTCreator to use the project folder like itself is doing with linking libraries?
      To copy always the "Plugins" folder to the Debug folder is an unwanted hack.
      I think in all I need the same path as the projectfile $$PWD
      Any solution`?

      A Offline
      A Offline
      Anonymous_Banned275
      wrote on 2 May 2021, 02:44 last edited by
      #2

      @pixbyte Can you show your "Projects" tree? Fully expanded.
      Not sure how your "Plugin" folder relates to your primary project.
      Would it be something like "SUB_DIRS" scheme?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 2 May 2021, 06:24 last edited by mrjj 5 Feb 2021, 06:25
        #3

        Hi

        It is possible to get the project file location via

        (in .pro file)

        DEFINES += SRCDIR=\\\"$$PWD/\\\"
        

        So you can load it from there.

        However the more common approach is to copy the plugin to the build folder.
        either via the .pro file or manually.

        That way it will work the same when the app is deployed.
        ( the plugins are in the same relative path to the exe)

        If you use the project folder path, you must have another way to load them when out in the real world - as clearly the actual project folder path does not exist on other computers.

        https://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output/3984180#3984180

        1 Reply Last reply
        1

        1/3

        1 May 2021, 19:56

        • Login

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