Copy folder with QDir
-
Hello developers!
I was try copy a folder to my project. I think that using Qdir that is not possible. I am wrong? Somebody have other idea? thanks !
(i dont know speak english very well, sorry!) -
You can open the directory with "QDir":http://qt-project.org/doc/qt-5.0/qtcore/qdir.html, loop through all files and use "QFile":http://qt-project.org/doc/qt-5.0/qtcore/qfile.html method "copy":http://qt-project.org/doc/qt-5.0/qtcore/qfile.html#copy. Recursively process the sub directories.
You can see more ideas and examples at the similar "thread":http://qt-project.org/forums/viewthread/10515
-
How can i do that, if i dont have the name of the files?
-
[quote author="felipe.c.sousa" date="1358433843"]How can i do that, if i dont have the name of the files? [/quote]
Use QDir. I highly recommend you to read QDir documentation :)
@
QDir directory("/home/mydir/");
QStringList files = directory.entryList();
@ -
haha i try do this way. but i can not acess a folder shared from a other computer...
-
[quote author="felipe.c.sousa" date="1358436079"]but i can not acess a folder shared from a other computer... [/quote]
First test your source code with directories on your local drive. After that make sure you have appropriate permission and then try to load shared directories.
Btw you are talking about shared foldesr so you are using Windows, aren't you?
-
yes. and i will do try local