def focusInEvent(self, e): # event 상속 self.setPalette(self.newPalette) if self.clearOnFocus: self.clear() QLineEdit.focusInEvent(self, e)
def focus_in_event(self, event: QFocusEvent) -> None: if self.completer: self.completer.setWidget(self) QLineEdit.focusInEvent(self, event)