Answer the question
In order to leave comments, you need to log in
How to find file location for writing in Qt?
The application is located on drive D in the /projects/ folder. I
run the application, both Debug and Release are created there, but it does not pick up .txt files in which I need to write data. Debug figured out ( QDir::currentPath() ) that the current directory is set to c:/users/.....
What needs to be changed to make the application start with release or debug?
Answer the question
In order to leave comments, you need to log in
If you just need to do this, specify the absolute path to the files. If you need to do it more or less correctly, use doc.qt.io/qt-5/qstandardpaths.html#StandardLocatio...
You can change the TARGET variable in the .pro file.
Specify, for example, TARGET= ../Bin/MyApp
. You can also access files using the full path:
QCoreApplication::applicationDirPath()+"/config.ini"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question