As far as the filesystem is concerned, there is no concept of drives in Unix/Linux (I can't vouch for MacOSX but I'd say it's the same). The closest thing would probably be mount points, but a normal application shouldn't bother about them since all is already available under the filesystem root
/ (hence the behaviour of
QDir::drives() that you observe).
If you really want to see which mount points are in use, you could parse the output of the
mount command (without any arguments) or, at least on Linux, the contents of the
/etc/mtab file. Beware though, mount points can get pretty hairy real quick (loop devices, FUSE filesystems, network shares, ...) so, again, I wouldn't recommend making use of them unless your application is designed to administer them.
Keep in mind that on Unix-y OSes, mount points are normally a matter for system administrators, not end-users, unless we're speaking of removable media or transient network shares.
Edit: Following your clarifications in the comments, on Linux you should use
getmntent_r to parse the contents of the
/etc/mtab file and thus get a list of all mount points and the corresponding devices.
The trick after that is to determine which ones you want to display (removable? network share?). I know that
/sys/block/... can help with that, but I don't know all the details so you'll have to dig a bit more.
For example, to check whether
/dev/sdd1 (a USB key) mounted on
/media/usb0/ is a removable device, you could do (note how I use the device name
sdd, not the partition name
$ cat /sys/block/sdd/removable 1
As opposed to my main hard drive:
$ cat /sys/block/sda/removable 0
Hope this puts you on the right track.