Advertisement
Guest User

Untitled

a guest
May 14th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import sys
  5. from PyQt5.QtWidgets import *
  6. from PyQt5.QtGui import *
  7. from PyQt5.QtCore import *
  8. from PyQt5.QtCore import pyqtSlot,pyqtSignal
  9.  
  10. class QutieBar(QProgressBar):
  11. value = 0
  12.  
  13. @pyqtSlot()
  14. def increaseValue(progressBar):
  15. progressBar.setValue(progressBar.value)
  16. progressBar.value = progressBar.value+1
  17.  
  18. # Create an PyQT4 application object.
  19. a = QApplication(sys.argv)
  20.  
  21. # The QWidget widget is the base class of all user interface objects in PyQt4.
  22. w = QWidget()
  23.  
  24. # Set window size.
  25. w.resize(320, 240)
  26.  
  27. # Set window title
  28. w.setWindowTitle("Progressbar")
  29.  
  30. # Create progressBar.
  31. bar = QutieBar(w)
  32. bar.resize(320,50)
  33. bar.setValue(0)
  34. bar.move(0,20)
  35.  
  36. # create timer for progressBar
  37. timer = QTimer()
  38. bar.connect(timer, SIGNAL("timeout()"), bar, SLOT("increaseValue()"))
  39. timer.start(400)
  40.  
  41. # Show window
  42. w.show()
  43.  
  44. sys.exit(a.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement