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. how to get path of current directory in Qt
Forum Update on Monday, May 27th 2025

how to get path of current directory in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 336 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    I have have file in current directory

    I have file
    /a/b/c/d

    I Ineed to form a path
    /a/b/e/f

    how to do that

    and how to get the path of currect directoty

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

      Hi
      "I have file
      /a/b/c/d"
      That looks a bit more like a path ?
      is d the file ?

      There is
      QDir::currentPath()
      amount others.

      1 Reply Last reply
      1
      • Q Qt Enthusiast

        I have have file in current directory

        I have file
        /a/b/c/d

        I Ineed to form a path
        /a/b/e/f

        how to do that

        and how to get the path of currect directoty

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @Qt-Enthusiast
        See the QDir and QFile docs

        and how to get the path of currect directoty

        QDir::current(), or do you mean of the executable?
        FOr the executable see QCoreApplication::applicationDirPath()

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        2

        • Login

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