MCPcopy Index your code
hub / github.com/PyQt5/PyQt / Window

Class Window

QWebView/PlayFlash.py:22–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21
22class Window(QWebView):
23
24 def __init__(self, *args, **kwargs):
25 super(Window, self).__init__(*args, **kwargs)
26 self.resize(800, 600)
27 # 浏览器设置
28 setting = QWebSettings.globalSettings()
29 setting.setAttribute(QWebSettings.PluginsEnabled, True)
30 # 解决xp下ssl问题
31 self.page().networkAccessManager().sslErrors.connect(self.handleSslErrors)
32 sslconf = QSslConfiguration.defaultConfiguration()
33 clist = sslconf.caCertificates()
34 cnew = QSslCertificate.fromData(b"CaCertificates")
35 clist.extend(cnew)
36 sslconf.setCaCertificates(clist)
37 sslconf.setProtocol(QSsl.AnyProtocol)
38 QSslConfiguration.setDefaultConfiguration(sslconf)
39
40 def handleSslErrors(self, reply, errors):
41 # 解决ssl错误
42 reply.ignoreSslErrors()
43
44
45if __name__ == '__main__':

Callers 1

PlayFlash.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected