Hello,
in the following code the JavaScript is launched before the loading of the HTML 
page.

Is there a way to call a JavaScript only when the whole page is loaded in the 
QWebView ?

Best regards.
Christophe.


======================================================

# -*- coding: utf-8 -*-
#!/usr/bin/env python

# Source
#    http://www.slideshare.net/tewson/using-qtwebkit-in-pyqt-as-a-n00b

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

app = QApplication(sys.argv)
myWebKit = QWebView()
myWebKit.show()

myWebKit.setUrl(QUrl("http://www.google.fr/";))

myWebKit.page().mainFrame().evaluateJavaScript("alert('Hello, World !');")

sys.exit(app.exec_())

# -*- coding: utf-8 -*-
#!/usr/bin/env python

# Source
#    http://www.slideshare.net/tewson/using-qtwebkit-in-pyqt-as-a-n00b

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

app = QApplication(sys.argv)
myWebKit = QWebView()
myWebKit.show()

myWebKit.setUrl(QUrl("http://www.google.fr/";))

myWebKit.page().mainFrame().evaluateJavaScript("alert('Hello, World !');")

sys.exit(app.exec_())
_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to