548 |
548 |
549 ############################################################# |
549 ############################################################# |
550 ## Methods below implement protocol handler related functions |
550 ## Methods below implement protocol handler related functions |
551 ############################################################# |
551 ############################################################# |
552 |
552 |
553 @pyqtSlot("QWebEngineRegisterProtocolHandlerRequest") |
553 try: |
554 def __registerProtocolHandlerRequested(self, request): |
554 @pyqtSlot("QWebEngineRegisterProtocolHandlerRequest") |
555 """ |
555 def __registerProtocolHandlerRequested(self, request): |
556 Private slot to handle the registration of a custom protocol handler. |
556 """ |
557 |
557 Private slot to handle the registration of a custom protocol handler. |
558 @param request reference to the registration request |
558 |
559 @type QWebEngineRegisterProtocolHandlerRequest |
559 @param request reference to the registration request |
560 """ |
560 @type QWebEngineRegisterProtocolHandlerRequest |
561 from PyQt5.QtWebEngineCore import \ |
561 """ |
562 QWebEngineRegisterProtocolHandlerRequest |
562 from PyQt5.QtWebEngineCore import \ |
563 |
563 QWebEngineRegisterProtocolHandlerRequest |
564 if self.__registerProtocolHandlerRequest: |
564 |
565 del self.__registerProtocolHandlerRequest |
565 if self.__registerProtocolHandlerRequest: |
566 self.__registerProtocolHandlerRequest = None |
566 del self.__registerProtocolHandlerRequest |
567 self.__registerProtocolHandlerRequest = \ |
567 self.__registerProtocolHandlerRequest = None |
568 QWebEngineRegisterProtocolHandlerRequest(request) |
568 self.__registerProtocolHandlerRequest = \ |
|
569 QWebEngineRegisterProtocolHandlerRequest(request) |
|
570 except TypeError: |
|
571 # this is supported with Qt 5.12 and later |
|
572 pass |
569 |
573 |
570 def registerProtocolHandlerRequestUrl(self): |
574 def registerProtocolHandlerRequestUrl(self): |
571 """ |
575 """ |
572 Public method to get the registered protocol handler request URL. |
576 Public method to get the registered protocol handler request URL. |
573 |
577 |