Skip to content

Instantly share code, notes, and snippets.

@marcellmars
Created April 27, 2015 20:57
Show Gist options
  • Save marcellmars/2ce85af54af4c25df5b0 to your computer and use it in GitHub Desktop.
Save marcellmars/2ce85af54af4c25df5b0 to your computer and use it in GitHub Desktop.
simple web view
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