[Qt-interest] Progress Bar Logic

Andre Somers andre at familiesomers.nl
Fri May 28 09:58:59 CEST 2010


On 27-5-2010 12:16, Ramesh wrote:
>
> Yogesh,
>
> I have not worked on Qt copy files. But as per my speculation, Qt has 
> better API than what linux command which you use to Copy.
>
> Just googleit or look around the documentation , you may get solution.
>
> *From:* yogesh upreti [mailto:yogesh.upreti at gmail.com]
> *Sent:* Thursday, May 27, 2010 3:21 PM
> *To:* Ramesh
> *Cc:* qt-interest at trolltech.com
> *Subject:* Re: Progress Bar Logic
>
> Hallo Ramesh,
>
> Thanks for reply. I am using system command ("copy" for windows and cp 
> for "unix") to copy files.
>
> How do I get the ammount of data copied? or is there a better way to 
> copy file using any QT Function, so that I get also the ammount of 
> data copied?
>
> Thanks
>
>

Qt provides QFile::copy, but that does not provide progress information. 
Nor do the windows command copy or cp on *nix, AFAIK.
To do that, I think you'll have to implement the data copy yourself, by 
reading chunks of data from your source file, and writing them away to 
your destination file. You can then keep track of progress yourself, as 
you know how big the source file is, and how many bytes you have read so 
far.

André

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100528/ae00408f/attachment.html 


More information about the Qt-interest-old mailing list