01.class MyClass : ...        
02.{        
03....        
04.public slots:        
05.        void onWrite( qint64 );        
06.};        
07.    
08.MyClass::MyClass( ... )        
09.{        
10.        // ...        
11.        progress->setMaximum( QFileInfo(fromFile).size() / 1024 );        
12.        written = 0;        
13.        connect( &toFile, SIGNAL(bytesWritten(qint64)), SLOT(onWrite(qint64)) );        
14.        // ...        
15.}        
16.    
17.void MyClass::onWrite( qint64 w )        
18.{        
19.        written += w;        
20.        progress->setValue( written / 1024 );        
21.}