PyQt QPushButton Background color

后端 未结 2 1146
长发绾君心
长发绾君心 2020-12-18 22:01

I have the follow code:

self.pushButton = QtGui.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(0, 550, 150, 31))
self.pushButton.setObjectName(_f         


        
2条回答
  •  半阙折子戏
    2020-12-18 22:20

    You can change the style of the button:

    self.pushButton.setStyleSheet("background-color: red")
    

    It's like CSS.

提交回复
热议问题