304 resDict["res"] = res |
304 resDict["res"] = res |
305 loop.quit() |
305 loop.quit() |
306 |
306 |
307 self.runJavaScript(script, worldId, resultCallback) |
307 self.runJavaScript(script, worldId, resultCallback) |
308 |
308 |
309 loop.exec_() |
309 loop.exec() |
310 return resultDict["res"] |
310 return resultDict["res"] |
311 |
311 |
312 def runJavaScript(self, script, worldId=-1, callback=None): |
312 def runJavaScript(self, script, worldId=-1, callback=None): |
313 """ |
313 """ |
314 Public method to run a script in the context of the page. |
314 Public method to run a script in the context of the page. |
465 resDict["res"] = res |
465 resDict["res"] = res |
466 loop.quit() |
466 loop.quit() |
467 |
467 |
468 self.print(printer, printCallback) |
468 self.print(printer, printCallback) |
469 |
469 |
470 loop.exec_() |
470 loop.exec() |
471 return resultDict["res"] |
471 return resultDict["res"] |
472 |
472 |
473 def __contentsSizeChanged(self, size): |
473 def __contentsSizeChanged(self, size): |
474 """ |
474 """ |
475 Private slot to work around QWebEnginePage not scrolling to anchors |
475 Private slot to work around QWebEnginePage not scrolling to anchors |