Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- import sys
- from PyQt5.QtWidgets import *
- from PyQt5.QtGui import *
- from PyQt5.QtCore import *
- from PyQt5.QtCore import pyqtSlot,pyqtSignal
- class QutieBar(QProgressBar):
- value = 0
- @pyqtSlot()
- def increaseValue(progressBar):
- progressBar.setValue(progressBar.value)
- progressBar.value = progressBar.value+1
- # Create an PyQT4 application object.
- a = QApplication(sys.argv)
- # The QWidget widget is the base class of all user interface objects in PyQt4.
- w = QWidget()
- # Set window size.
- w.resize(320, 240)
- # Set window title
- w.setWindowTitle("Progressbar")
- # Create progressBar.
- bar = QutieBar(w)
- bar.resize(320,50)
- bar.setValue(0)
- bar.move(0,20)
- # create timer for progressBar
- timer = QTimer()
- bar.connect(timer, SIGNAL("timeout()"), bar, SLOT("increaseValue()"))
- timer.start(400)
- # Show window
- w.show()
- sys.exit(a.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement