diff -r 62b50a24fb59 -r 0367675d783d WebBrowser/WebBrowserPage.py --- a/WebBrowser/WebBrowserPage.py Sun Feb 07 19:36:07 2016 +0100 +++ b/WebBrowser/WebBrowserPage.py Mon Feb 08 20:56:16 2016 +0100 @@ -34,6 +34,8 @@ from .JavaScript.ExternalJsObject import ExternalJsObject +from .Tools.WebHitTestResult import WebHitTestResult + import Preferences import UI.PixmapCache import Globals @@ -721,14 +723,14 @@ """ loop = QEventLoop() resultDict = {"res": None} + QTimer.singleShot(500, loop.quit); def resultCallback(res, resDict=resultDict): if loop and loop.isRunning(): resDict["res"] = res loop.quit() - self.previewView.page().runJavaScript( - script, resultCallback) + self.runJavaScript(script, resultCallback) loop.exec_() return resultDict["res"] @@ -749,15 +751,14 @@ def hitTestContent(self, pos): """ - Public method to test the contents at a given position. + Public method to test the content at a specified position. - @param pos position to be tested + @param pos position to execute the test at @type QPoint - @return object containing the test results - @rtype WebBrowserHitTestResult + @return test result object + @rtype WebHitTestResult """ - # TODO: WebBrowserHitTestResult -## return WebBrowserHitTestResult(self, pos) + return WebHitTestResult(self, pos) def setupWebChannel(self): """