def paint(self, painter, option, widget=None): paint_option = option paint_option.state &= ~QStyle.State_Selected if self.isSelected(): self.setBrush(self.select_brush) elif self.hovering: self.setBrush(self.hover_brush) else: self.setBrush(self.orig_brush) QGraphicsRectItem.paint(self, painter, paint_option, widget)
def paint(self, painter, option, widget=None): paint_option = option paint_option.state &= ~QStyle.State_Selected QGraphicsRectItem.paint(self, painter, paint_option, widget)