Solved QProcess QDir::currentPath() error
-
Program A: QProcess *proc = new QProcess; proc->start(pathb); Program B: QDir::currentPath()
QDir::currentPath() in program B,changed to QDir::currentPath() of A, cause config file read and write error.
-
@sonichy Use http://doc.qt.io/qt-5/qprocess.html#setWorkingDirectory
As explained there:
"Sets the working directory to dir. QProcess will start the process in this directory. The default behavior is to start the process in the working directory of the calling process."