![]() |
2010-12-09
, 13:45
|
Posts: 52 |
Thanked: 41 times |
Joined on Sep 2010
|
#1
|
![]() |
2010-12-09
, 14:10
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#2
|
How can I recieve information about copying progress when using QFile.copy(...) ??? I use it to copy big files on n900, I want to make progress bar indicator. I found nothing on the web about this. Im writing in python but I think I could translate it from C++ If anyone knows the solution. Please help.
myFile = QFile("path/to/file") self.progressBar = QProgressBar(self) self.connect(myFile, SIGNAL("bytesWritten(qint64)"), self.updateProgress) def updateProgress(self, progress):""" Updates the progress bar"""self.progressBar.setValue(progress)
The Following 3 Users Say Thank You to marxian For This Useful Post: | ||
![]() |
2010-12-17
, 16:32
|
Posts: 52 |
Thanked: 41 times |
Joined on Sep 2010
|
#3
|
class Win(QMainWindow): def __init__(self): QMainWindow.__init__(self) (...) self.ui=WinUi() self.ui.setupUi(self) def updateProgress(self, progress): self.ui.progressBar.setValue(progress) self.ui.label.setText("Please wait, storing file..."+progress) (...) def clickchoose(self): (...) def click(self, place): foundone = 0 for root, dirs, files in os.walk('/home/user/MyDocs/tmp'): for file in files: foundone = 1 self.tempFile=QFile('/home/user/MyDocs/tmp/'+files[0]) self.connect(self.tempFile, SIGNAL("bytesWritten(qint64)"), self.updateProgress) (...) if fname[0]=="": filechk=self.tempFile.copy(place+files[0]) else: filechk=self.tempFile.copy(place+fname[0]+'.flv') if filechk==0: (...)