pyqt5 给按钮设置图标和css样式

it2024-05-08  45

设置图标 self.pushButton.setIcon(QIcon("sure.png"))

设置css样式

self.pushButton.setStyleSheet("QPushButton{color:black}" "QPushButton:hover{color:red}" "QPushButton{background-color:lightgreen}" "QPushButton{border:2px}" "QPushButton{border-radius:10px}" "QPushButton{padding:2px 4px}")

 

button in messagebox is still can be set its icon and css style.

最新回复(0)