Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
SetCurrentWorkingDirectory how to set it
appollosputnik Banned last edited by
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.
videl last edited by
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 ()@
Ok, there is a much simpler way. Use following method to set current working dir:
@bool QDir::setCurrent ( const QString & path ) [static]@