12345678910111213141516171819202122232425262728 |
- #!/usr/bin/python3
- from PyQt5.QtCore import QBasicTimer
- from PyQt5.QtWidgets import QProgressBar, QWidget
- class IlerlemeCubugu(QWidget):
- def __init__(self, ebeveyn=None):
- super(IlerlemeCubugu, self).__init__(ebeveyn)
- self.pbar = QProgressBar(self)
- self.pbar.setGeometry(250, 0, 300, 25)
- self.timer = QBasicTimer()
- self.step = 0
- def timerEvent(self, e):
- if self.step >= 100:
- self.timer.stop()
- return
- self.step = self.step + 1
- self.pbar.setValue(self.step)
- def ilerleyici(self,zaman):
- if self.timer.isActive():
- self.timer.stop()
- else:
- self.timer.start(zaman, self)
|