/*Example vor copy one file
QString file = QFileDialog::getOpenFileName(
"/home",
"Images (*.doc)",
this,
"open file dialog",
"Choose a file" );
QFileInfo fi( file);
QString base = fi.fileName();
QUrlOperator *op = new QUrlOperator();
QString src = file;
QString target = "D:/temp/" + base;
op->copy(src, target, false, false);
*/
/*Example vor copy one or more files*/
"All files (*.*)",
"",
this,
"open files dialog",
"Select one or more files to open" );
while( it != list.end() ) {
QUrlOperator *op = new QUrlOperator();
QString target
= "D:/temp/" + base;
op->copy(src, target, false, false);
++it;
}
/*Example vor copy one file
QString file = QFileDialog::getOpenFileName(
"/home",
"Images (*.doc)",
this,
"open file dialog",
"Choose a file" );
QFileInfo fi( file);
QString base = fi.fileName();
QUrlOperator *op = new QUrlOperator();
QString src = file;
QString target = "D:/temp/" + base;
op->copy(src, target, false, false);
*/
/*Example vor copy one or more files*/
QStringList files = QFileDialog::getOpenFileNames(
"All files (*.*)",
"",
this,
"open files dialog",
"Select one or more files to open" );
QStringList list = files;
QStringList::Iterator it = list.begin();
while( it != list.end() ) {
QFileInfo fi( *it);
QString base = fi.fileName();
QUrlOperator *op = new QUrlOperator();
QString src = *it;
QString target = "D:/temp/" + base;
op->copy(src, target, false, false);
++it;
}
To copy to clipboard, switch view to plain text mode
Bookmarks