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. SetCurrentWorkingDirectory how to set it
Qt 6.11 is out! See what's new in the release blog

SetCurrentWorkingDirectory how to set it

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • appollosputnikA Offline
    appollosputnikA Offline
    appollosputnik
    Banned
    wrote on last edited by
    #1

    I want to set my current working directory as something else..Not from where I launched the application. From where I am loading my model through file dialog that should be my current working directory. How can I set it. Please advice.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      videl
      wrote on last edited by
      #2

      Hello appollosputnik
      Usually you do not do such a thing with QDir, but if you are to change current working directory, I don't think you can do that from within of an application.

      The only way I know to do this is to change the working directory in the IDE (visual studio: Project Properties -> Configuration Properties -> Debugging -> Working Directory)

      You may also want to look at following QCoreApplication methods:
      @QString applicationDirPath ()
      QString applicationFilePath ()@

      [edit]

      Ok, there is a much simpler way. Use following method to set current working dir:
      @bool QDir::setCurrent ( const QString & path ) [static]@

      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