Hi everybody,
i am trying to copy a File over the Network and i would like to show in a progressbar the status of copy..
I have tried this example but it takes to long.
i heard about QUrlOperator, but under QT 4 its not working..
Could somebody show me how to copy a big file over the network and show the status in a progressbar?
QFile src
("W:\\1Data\\Public\\Transfer\\Notes.exe");
if(!src.
open(QFile::ReadOnly) ||
!dst.
open(QFile::WriteOnly)) return;
qint64 len = src.bytesAvailable();
ui.dlg->setRange(0,len);
ui.dlg->show();
char ch;
while(!src.atEnd()){
src.getChar(&ch);
dst.putChar(ch);
ui.dlg->setValue(ui.dlg->value()+1);
qApp->processEvents();}
QFile src("W:\\1Data\\Public\\Transfer\\Notes.exe");
QFile dst("notes.exe");
if(!src.open(QFile::ReadOnly) || !dst.open(QFile::WriteOnly)) return;
qint64 len = src.bytesAvailable();
ui.dlg->setRange(0,len);
ui.dlg->show();
char ch;
while(!src.atEnd()){
src.getChar(&ch);
dst.putChar(ch);
ui.dlg->setValue(ui.dlg->value()+1);
qApp->processEvents();}
To copy to clipboard, switch view to plain text mode
Thanks
Bookmarks