def paintEvent(self, event):
"""
绘制阴影
:param event:
:return:
"""
path = QtGui.QPainterPath()
path.setFillRule(QtCore.Qt.WindingFill)
path.addRect(10, 10, self.width() - 20, self.height() - 20)
painter = QtGui.QPainter(self)
painter.setRenderHint(QtGui.QPainter.Antialiasing, True)
painter.fillPath(path, QtGui.QBrush(QtCore.Qt.white))
color = QtGui.QColor(0, 0, 0, 50)
for i in range(0, 10):
path = QtGui.QPainterPath()
path.setFillRule(QtCore.Qt.WindingFill)
path.addRect(10 - i, 10 - i, self.width() - (10 - i) * 2, self.height() - (10 - i) * 2)
color.setAlpha(150 - math.sqrt(i) * 50)
painter.setPen(color)
painter.drawPath(path)