ok, i tested a little again and to make my point clear here is my code:
Code:
QDir appDir(QApplication::applicationDirPath());
QString fileName = QApplication::applicationDirPath() + "/version.txt";
QFile testFile(fileName);
qDebug() << "App dir:" << QApplication::applicationDirPath();
qDebug() << "AppDir Exists:" << appDir.exists();
qDebug() << "File:" << fileName;
qDebug() << "File Exists:" << QFile::exists(fileName);
qDebug() << "Copy:" << testFile.copy(QApplication::applicationDirPath() + "/test.txt");
qDebug() << "Copy in Subdir:" << testFile.copy(QApplication::applicationDirPath() + "/test/test.txt");
qDebug() << "Subdir Exists:" << QDir(QApplication::applicationDirPath() + "/test").exists();
qDebug() << "mkpath Subdir" << QDir().mkpath(QApplication::applicationDirPath() + "/test");
qDebug() << "mkdir Subdir:" << appDir.mkdir("test");
qDebug() << "Subdir Exists:" << QDir(QApplication::applicationDirPath() + "/test").exists();
qDebug() << "Copy in Subdir:" << testFile.copy(QApplication::applicationDirPath() + "/test/test.txt");
Output:
[Qt Message] App dir: "C:/Private/e68fb921"
[Qt Message] AppDir Exists: false
[Qt Message] File: "C:/Private/e68fb921/version.txt"
[Qt Message] File Exists: true
[Qt Message] Copy: true
[Qt Message] Copy in Subdir: false
[Qt Message] Subdir Exists: false
[Qt Message] mkpath Subdir false
[Qt Message] mkdir Subdir: true
[Qt Message] Subdir Exists: true
[Qt Message] Copy in Subdir: true
Unexpected behaviour: not working mkpath and not working exists() function on the path. still looks like a qt bug to me.