def paintWindowFrame(self, painter, option, widget):
color = QColor(0, 0, 0, 64)
r = self.windowFrameRect()
right = QRectF(r.right(), r.top()+10, 10, r.height()-10)
bottom = QRectF(r.left()+10, r.bottom(), r.width(), 10)
intersectsRight = right.intersects(option.exposedRect)
intersectsBottom = bottom.intersects(option.exposedRect)
if intersectsRight and intersectsBottom:
path = QPainterPath()
path.addRect(right)
path.addRect(bottom)
painter.setPen(Qt.NoPen)
painter.setBrush(color)
painter.drawPath(path)
elif intersectsBottom:
painter.fillRect(bottom, color)
elif intersectsRight:
painter.fillRect(right, color)
super(CustomProxy, self).paintWindowFrame(painter, option, widget)
评论列表
文章目录