Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Changing button color doesn't work !



  • When I change the color of the Button "OK", it doesn't work
    imane.png

    This is what happen:
    imane1.png

    I don't even see the button "OK", so I want to change the button color in white, but it doesn't work when i write this :
    msgBox.setStyleSheet("background : solid black; QMessageBox QPushButton{color: white; }");



  • @fres try setting like this
    msgBox.setStyleSheet("QDialog{background-color:black;}QPushButton{background-color:white;}");



  • Thanks it works!


Log in to reply