def showEvent(self, e): #QTimer.singleShot(0, lambda: windows.goto(hwnd(self))) self.inp.setFocus() if not self.completer.popuped: QTimer.singleShot(0, lambda: self._try_query(self.inp.text())) self.super.showEvent(e)
def _try_popup(self, content): # don't show popup if search box is hidden if self.isVisible(): QTimer.singleShot(0, lambda: self.popup(content))
def show_window(self): self.show() QTimer.singleShot(42, lambda: self.client.goto(hwnd(self)))
def _try_query(self, text): """Avoid line editor frozen when key continues pressed.""" QTimer.singleShot(0, lambda: self.query(text))
def _continues_update(self): if self.popuped: self._update_popup() QTimer.singleShot(1000, self._continues_update)