PDA

View Full Version : Move a folder



vishesh
2nd July 2007, 18:56
How to move a folder in Qt?

jpn
2nd July 2007, 23:05
bool QDir::rename( const QString & oldName, const QString & newName )



Renames a file or directory from oldName to newName, and returns true if successful; otherwise returns false.

On most file systems, rename() fails only if oldName does not exist, if newName and oldName are not on the same partition or if a file with the new name already exists. However, there are also other reasons why rename() can fail. For example, on at least one file system rename() fails if newName points to an open file.