Created
April 27, 2015 20:57
-
-
Save marcellmars/2ce85af54af4c25df5b0 to your computer and use it in GitHub Desktop.
simple web view
This file contains hidden or 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
import sys | |
from PyQt4 import QtGui | |
from PyQt4 import QtCore | |
from PyQt4 import QtWebKit | |
app = QtGui.QApplication(sys.argv) | |
webview = QtWebKit.QWebView() | |
webview.setUrl(QtCore.QUrl("http://www.python.org")) | |
websettings = webview.page().settings() | |
#websettings.setAttribute(QtWebKit.QWebSettings.DeveloperExtrasEnabled, True) | |
#websettings.setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True) | |
def sslErrorHandler(reply, errorList): | |
reply.ignoreSslErrors() | |
print ("SSL error ignored") | |
webview.connect(webview.page().networkAccessManager(), QtCore.SIGNAL("sslErrors (QNetworkReply *, const QList<QSslError> &)"), sslErrorHandler) | |
webview.resize(500,500) | |
webview.show() | |
app.exec_() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment