def add_shadow(self,button):self.effect_shadow = QGraphicsDropShadowEffect(self)self.effect_shadow.setOffset(0,0) self.effect_shadow.setBlurRadius(30) self.effect_shadow.setColor(QtCore.Qt.gray) button.setGraphicsEffect(self.effect_shadow)
使用
self.add_shadow(button_eval)
具体效果