Qt 6.11 is out! See what's new in the release
blog
How to find what directory QFile is opening files from
General and Desktop
3
Posts
3
Posters
5.2k
Views
1
Watching
-
Hi,
If you give QFile a relative path, QFile will use your Working Directory (also known as the Current Directory). You can use the "QDir":http://doc.qt.io/qt-5/qdir.html class to get and set your working directory. See QDir::currentPath() and QDir::setCurrentPath().
-
Hi,
If you path doesn't start with / on *nix system then it's relative to the current path. If you want to e.g. load file from directories in the same folder as your application you can use QCoreApplication::applicationDirPath() to build your paths