推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
flyer103
V2EX  ›  Python

QtWebKit 中,如何在超时后关闭某个 http 请求?

  •  
  •   flyer103 · Oct 26, 2012 · 5748 views
    This topic created in 5093 days ago, the information mentioned may be changed or developed.
    使用 QtWebKit 中,可以发现在通过 QWebPage().mainFrame().load(QUrl(url)) 后,会有很多请求自动发送,如请求 js、css 文件等。那么该如何设置每个请求的等待时间,当请求超时时,关闭超时的 js、css 等请求?

    我觉得可以在 QNetworkAccessManager 的子类中设置,通过 QNetworkReply 的 abort() 方法放弃某个发送过的 http 请求,但没找到合适的方法来获得 QNetworkReply 对象来使用 abort() 方法。另外,使用 QTimer 设置超时的 slot 时,该如何向 slot 传递自定义的参数?如果这个问题能解决,我觉得就可以在 QTimer 设置的超时的 slot 中传入 QNetworkReply 对象来实现我想要的功能。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2281 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 04:54 · PVG 12:54 · LAX 21:54 · JFK 00:54
    ♥ Do have faith in what you're doing.