Welcome to the Csdn-markdown Editor

Source: Internet
Author: User

PYQT4 Exercise-Open a qwebframe with a proxy
2015-7-2 15:24

 fromPyQt4ImportQtgui,qtcore fromPyQt4ImportQtwebkit fromPyQt4ImportQtnetworkImportSys class MainWindow(Qtgui.qmainwindow):     def __init__(self):Super (MainWindow, self). __init__ () Self.setwindowtitle (' Demos for MainWindow ')Print ' Initialize MainWindow ' class webmainwindow(qtwebkit.qwebview):     def __init__(self):Super (Webmainwindow, self). __init__ () Self.setwindowtitle (' Demos for Qtwebkit ')Print ' Initialize Webmainwindow 'URL =' http://www.sina.com 'Proxy_host ="* * * *"Proxy_port =8080 def set_app_proxy():Proxy = Qtnetwork.qnetworkproxy () proxy.settype (QtNetwork.QNetworkProxy.HttpProxy) proxy.sethostname (proxy_host) Proxy.setport (Proxy_port) QtNetwork.QNetworkProxy.setApplicationProxy (PROXY)if__name__ = =' __main__ ': App = Qtgui.qapplication (SYS.ARGV)#mw = MainWindow ()    #mw. Show ()    #set System ProxySet_app_proxy () MW = Webmainwindow () mw.load (Qtcore.qurl (URL)) mw.show () Sys.exit (App.exec_ ())

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Welcome to the Csdn-markdown Editor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.