使用QDir 里面的相关方法,QDir::current()获得当前Dir,然后使用cdUp()进到其父目录,两次调用应该就可以了具体请参考:http://qt-project.org/doc/qt-4.8/qdir.html