Reputation: 49
I want to get my current working DRIVE, not path. How do I do it? If it was for path I would have done something like:
QString curPath = dir.currentPath();
Not sure how to get the current working drive.
Upvotes: 0
Views: 1593
Reputation: 3754
The QStorageInfo class provides information about a drive - to get one for a directory:
QStorageInfo info(dir);
qDebug() << "Name: " << info.name();
qDebug() << "Root path: " << info.rootPath();
Upvotes: 3