[bugfix] progressText not updating in progressBar

This commit is contained in:
2018-07-18 11:13:29 +02:00
parent 37da7327d0
commit ed7ee5d944
3 changed files with 21 additions and 18 deletions

View File

@@ -41,23 +41,13 @@ class Thread(QThread):
def showProgressbar(self):
if self.progressText:
# generate widget if not given in init
if not self.pb_widget:
self.pb_widget = QDialog(self.parent())
self.pb_widget.setWindowFlags(Qt.SplashScreen)
self.pb_widget.setModal(True)
# # generate widget if not given in init
# if not self.pb_widget:
# self.pb_widget = ProgressBarWidget(self.parent())
# self.pb_widget.setWindowFlags(Qt.SplashScreen)
# self.pb_widget.setModal(True)
# add button
delete_button = QPushButton('X')
delete_button.clicked.connect(self.exit)
hl = QHBoxLayout()
pb = QProgressBar()
pb.setRange(0, 0)
hl.addWidget(pb)
hl.addWidget(QLabel(self.progressText))
if self.abortButton:
hl.addWidget(delete_button)
self.pb_widget.setLayout(hl)
self.pb_widget.label.setText(self.progressText)
self.pb_widget.show()
def hideProgressbar(self):

View File

@@ -119,6 +119,18 @@ def createAction(parent, text, slot=None, shortcut=None, icon=None,
return action
class ProgressBarWidget(QtGui.QWidget):
def __init__(self, parent=None):
super(ProgressBarWidget, self).__init__(parent)
self.hlayout = QtGui.QHBoxLayout()
self.pb = QtGui.QProgressBar()
self.pb.setRange(0, 0)
self.label = QLabel()
self.hlayout.addWidget(self.pb)
self.hlayout.addWidget(self.label)
self.setLayout(self.hlayout)
class ComparisonWidget(QWidget):
def __init__(self, c, parent=None, windowflag=1):
self._data = c