[Development] Proposal: virtual method of QtNetwork interfaces

Robert Knight robertknight at gmail.com
Sat Nov 3 13:46:07 CET 2012


> I wonder if your guys could modify the QNetworkAccessManager's method declaration(get, post, put...), make them be virtual,
> so that I can derive a subclass and modify the implementation

You can already do this.  Re-implement the protected createRequest() method.

Regards,
Rob.

On 3 November 2012 12:42, Yang Fan <missdeer at gmail.com> wrote:
> Hi list,
>
> I'm writing a network program which runs on MS Windows, Linux and Mac OS X.
> All things look good but it seems that the network performance needs
> improving. I see the QtNetwork module especially the QNetworkAccessManager
> class which I'm mainly using in my program  is implemented using cross
> platform select model, this model is designed for easy using but not for
> good performance such as low latency and high throughout, every Operating
> System provide a special socket/IO model to let applications have good
> performance, for example, MS Windows provides IO completion port model,
> Linux (>= 2.6 kernel) provides epoll/AIO model, BSD/Mac OSX provide kqueue
> etc. So I want to  provide my customized NetworkAccessManager class, but I
> don't want to modify the Qt's source code since I will use Boost.asio
> library which depends on Boost library, a very big library that is not
> suitable to include in Qt as a 3rd party library. I wonder if your guys
> could modify the QNetworkAccessManager's method declaration(get, post,
> put...), make them be virtual, so that I can derive a subclass and modify
> the implementation. The reason I need a subclass of QNetworkAccessManager
> not a new class is, I also want my class could be set as the network engine
> of QtWebkit.
> Feel free to reply if you have any other good idea.
>
> Regards,
> Fan Yang
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>



More information about the Development mailing list