How can i change the color of the Value text for a QProgressDialog / QProgressBar?

1.2k Views Asked by At

I'm looking to change the colour of the Value text from default black to white.

enter image description here

I've got a stylesheet, but the color: white only seems to apply to the text, not the value text.

'''
Load UI
'''
if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    app.setStyleSheet("""
        QMainWindow {background-color: rgb(80,80,80); color: white;}
        QProgressDialog {background-color: rgb(80,80,80); color: white;}
                     """)
sys.exit(app.exec_())

I've also tried adding the QProgressBar to the stylesheet, but this didn't do anything either.

This is my code for the progress dialog:

def pathCasingFixFUNC(self):
    '''
    Fixes the path files that were named badly in notepad ++
    '''
    self.XprobBadCasing = ["List of bad file paths i'm checking"]

    Xprogress = QtGui.QProgressDialog("Converting Path Names...", "Cancel", 0, len(self.XprobBadCasing), self)
    Xprogress.setWindowModality(QtCore.Qt.WindowModal)
    Xprogress.setWindowTitle('Processing')

Can i set the value font colour using Xprogress.value.setFont() or something?

0

There are 0 best solutions below