How to set QWebView's socket options?

寵の児 提交于 2020-01-14 04:09:09

问题


I want to set socket options such as receive buffer size,tcpNoDelay with QWebView.But i could not find any methods in QWebView to do this.I can't get the connection socket from QWebView,any idea? Thanks.


回答1:


QWebView doesn't use QTcpSocket directly. It uses QNetworkAccessManager. QNetworkAccessManager doesn't expose access to QTcpSockets. The only thing I can think of to control such things is to inherit QNetworkAccessManager, override createRequest method, that provides own QNetworkReply with own QTcpSocket inside. Note that your request with plain QTcpSocket may not work with proxy servers as well as QNetworkReply provided by generic QNetworkAccessManager



来源:https://stackoverflow.com/questions/11303904/how-to-set-qwebviews-socket-options

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!