PDA

View Full Version : Moving a file (QT3)



Kubil
21st December 2007, 05:18
Hi All,

i know there is function to move a file (QFile::rename) in QT4,
is there similar function in QT3,
thanks.

marcel
21st December 2007, 08:05
Isn't it QFile::rename()?

Edit: actually, it is not. You can use QDir::rename(). (http://doc.trolltech.com/3.3/qdir.html#rename)
Works for files too.

Kubil
22nd December 2007, 09:02
i`m confuse :),
can you show me how to use QDir for moving files,
currently my application scan a directory for files, then based on file size it will move to
certain directory, eg. size range 1kb - 1mb, will moved to another directory.
the last step i haven`t done is how to move these file.
thanks.

wysota
22nd December 2007, 19:43
There is an example in the docs on how to use QDir::rename.