Created
October 27, 2011 16:42
-
-
Save pib/1320092 to your computer and use it in GitHub Desktop.
Injecting a QNetworkAccessManager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inject(self, webview): | |
""" Replace the old QNetworkAccessManager instance with this | |
instance. | |
""" | |
old_manager = webview.page().networkAccessManager() | |
self.setCache(old_manager.cache()) | |
self.setCookieJar(old_manager.cookieJar()) | |
self.setProxy(old_manager.proxy()) | |
self.setProxyFactory(old_manager.proxyFactory()) | |
webview.page().setNetworkAccessManager(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment