I am trying to turn a QDir which can contain relative or absolute paths into a list of folders in a QStringList like this:
const QString path = dir.path ();
return path.split (QRegExp ("[\\/]+"), QString::SkipEmptyParts);
This ideally would turn a path like C:\foo\bar into a list of strings "C:", "foo", and "bar"
Is there a better way to do this that is already implemented in Qt?