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()
评论列表
文章目录