767 def setupWebChannel(self): |
767 def setupWebChannel(self): |
768 """ |
768 """ |
769 Public method to setup a web channel to our external object. |
769 Public method to setup a web channel to our external object. |
770 """ |
770 """ |
771 oldChannel = self.webChannel() |
771 oldChannel = self.webChannel() |
772 newChannel = QWebChannel() |
772 newChannel = QWebChannel(self) |
773 newChannel.registerObject("eric_object", ExternalJsObject(self)) |
773 newChannel.registerObject("eric_object", ExternalJsObject(self)) |
774 self.setWebChannel(newChannel) |
774 self.setWebChannel(newChannel) |
775 |
775 |
776 if oldChannel: |
776 if oldChannel: |
777 del oldChannel.registeredObjects["eric_object"] |
777 del oldChannel.registeredObjects["eric_object"] |