class MyProgressBar(QtGui.QProgressBar): def setValue(self, value): QtGui.QProgressBar.setValue(self, value) if value == self.maximum(): palette = QtGui.QPalette(self.palette()) palette.setColor(QtGui.QPalette.Highlight, QtGui.QColor(QtCore.Qt.red)) self.setPalette(palette)