Skip to content

Instantly share code, notes, and snippets.

@manashmandal
Created September 4, 2016 18:40
Show Gist options
  • Save manashmandal/bd439ffd035c24a965d254d97145d5bb to your computer and use it in GitHub Desktop.
Save manashmandal/bd439ffd035c24a965d254d97145d5bb to your computer and use it in GitHub Desktop.
from PyQt5.QtWidgets import QDialog, QProgressBar, QLabel, QHBoxLayout
from PyQt5.QtCore import pyqtSlot
class ProgressBar_Dialog(QDialog):
def __init__(self):
super(ProgressBar_Dialog ,self).__init__()
self.init_ui()
def init_ui(self):
# Creating a label
self.progressLabel = QLabel('Progress Bar:', self)
# Creating a progress bar and setting the value limits
self.progressBar = QProgressBar(self)
self.progressBar.setMaximum(100)
self.progressBar.setMinimum(0)
# Creating a Horizontal Layout to add all the widgets
self.hboxLayout = QHBoxLayout(self)
# Adding the widgets
self.hboxLayout.addWidget(self.progressLabel)
self.hboxLayout.addWidget(self.progressBar)
# Setting the hBoxLayout as the main layout
self.setLayout(self.hboxLayout)
self.setWindowTitle('Dialog with Progressbar')
self.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment