I know that this question is already quite old by now, but I searched stackoverflow and found that nobody got solution for this, so I decided to post.
There is QSystemStorageInfo class in QtMobility, it provides cross-platform way to get info about logical drives. For example: logicalDrives() returns list of paths which you can use as parameters for other methods: availableDiskSpace(), totalDiskSpace() to get free and total drive s space, accordingly, in bytes.
Usage example:
QtMobility::QSystemStorageInfo sysStrgInfo;
QStringList drives = sysStrgInfo.logicalDrives();
foreach (QString drive, drives)
{
qDebug() << sysStrgInfo.availableDiskSpace(drive);
qDebug() << sysStrgInfo.totalDiskSpace(drive);
}
This example prints free and total space in bytes for all logical drives in OS. Don t forget to add QtMobility in Qt project file:
CONFIG += mobility
MOBILITY += systeminfo
I used these methods in a project I m working on now and it worked for me. Hope it ll help someone!