Acabei de encontrar a mesma pergunta em um projeto baseado em Qt / C ++ e encontrei esta solução simples e portátil:
#include <QFileInfo>
...
#include <sys/stat.h>
#include <sys/types.h>
...
bool SomeClass::isSameFileSystem(QString path1, QString path2)
{
// - path1 and path2 are expected to be fully-qualified / absolute file
// names
// - the files may or may not exist, however, the folders they belong
// to MUST exist for this to work (otherwise stat() returns ENOENT)
struct stat stat1, stat2;
QFileInfo fi1(path1), fi2(path2),
stat(fi1.absoluteDir().absolutePath().toUtf8().constData(), &stat1);
stat(fi2.absoluteDir().absolutePath().toUtf8().constData(), &stat2);
return stat1.st_dev == stat2.st_dev;
}