take a look at QString::split and use '/' as the separator

or you could use QString::section, again use '/' as the separator

both of these show nice examples on how to use them.