PDA

View Full Version : What 's the system level api inside QApplication that QNetworkRequest utilize?



huyanke
11th May 2011, 02:58
hi,

I am new to Qt. I see when using Qt make a http request, it will use QNetworkRequest and QNetworkReply, when I step into the source code of Qt, I see QNetworkRequest inherit from QNetworkRequestPrivate, and QNetworkRequestPrivate inherit from QSharedData and also some QSharedDataPointer stuff. I guess QApplication is a main thread, and QNetworkRequest will make http call through QApplication, but what is the exact system level api QNetworkRequest utilize
to make the http request? I step into QApplication trying to find it, but it's too complex for me.

I hope I can get some help here, and thank you so much for your time.

Cheers,
Yanke

ChrisW67
11th May 2011, 04:56
QNetworkAccessManager takes QNetworkRequests and returns QNetworkReplys. The components use the Qt signals and slots mechanism to advise of state changes, and this relies on the logic in QCoreApplication to function.

Qt uses the underlying operating system's networking API to communicate. If you really want the low level details then look at the Qt source under "src/network".

huyanke
11th May 2011, 17:59
Thank you , Chris! Your information is very useful.

I will pay attention to use
next time!