def leaveEvent(self, event): self.setAutoFillBackground(False) self.setForegroundRole(QPalette.WindowText) QLabel.leaveEvent(self, event)