Hello everyone. Now I want to access the parent directory by using cdUp(). For example, when the current directory is C:\SampleRoot\SampleFolder and I'd like to access C:\SampleRoot:

Qt Code:
  1. QDir tmpCurrDir = QDir::current();
  2. tmpCurrDir.cdUp();
  3. QString rootDir = tmpCurrDir.currentPath();
To copy to clipboard, switch view to plain text mode 

Even if there is a existed directory and cdUp() always return true, but when calling the currentPath() it will give C:\SampleRoot\SampleFolder not C:\SampleRoot. So what should I do?

Thanks a lot for everyone!