Helpviewer/UrlBar/UrlBar.py

branch
6_1_x
changeset 4708
d0d2f95bd712
parent 4632
ca310db386ed
child 5389
9b1c800daff3
equal deleted inserted replaced
4706:4cdd97fbc522 4708:d0d2f95bd712
380 """ 380 """
381 Protected method to handle key presses. 381 Protected method to handle key presses.
382 382
383 @param evt reference to the key press event (QKeyEvent) 383 @param evt reference to the key press event (QKeyEvent)
384 """ 384 """
385 if evt.key() == Qt.Key_Escape and self.__browser is not None: 385 if evt.key() == Qt.Key_Escape:
386 self.setText( 386 if self.__browser is not None:
387 str(self.__browser.url().toEncoded(), encoding="utf-8")) 387 self.setText(
388 self.selectAll() 388 str(self.__browser.url().toEncoded(), encoding="utf-8"))
389 self.selectAll()
390 completer = self.completer()
391 if completer:
392 completer.popup().hide()
389 return 393 return
390 394
391 currentText = self.text().strip() 395 currentText = self.text().strip()
392 if evt.key() in [Qt.Key_Enter, Qt.Key_Return] and \ 396 if evt.key() in [Qt.Key_Enter, Qt.Key_Return] and \
393 not currentText.lower().startswith("http://"): 397 not currentText.lower().startswith("http://"):

eric ide

mercurial