问题
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