Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. What 's the system level api inside QApplication that QNetworkRequest utilize?
QtWS25 Last Chance

What 's the system level api inside QApplication that QNetworkRequest utilize?

Scheduled Pinned Locked Moved Qt WebKit
8 Posts 4 Posters 4.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    huyanke
    wrote on last edited by
    #1

    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 get some help here, and thank you so much for your time.

    Cheers,
    Yanke

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      QNetworkRequest/QNetworkReplys are ultimately handled by a "QNetworkAccessManager":http://doc.qt.nokia.com/4.7/qnetworkaccessmanager.html. Offhand, I'm not sure what system-level API is used internally by that class, though the sources are available.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on last edited by
        #3

        bq. but what is the exact system level api QNetworkRequest utilize to make the http request?

        What do you mean exactly with that?

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • H Offline
          H Offline
          huyanke
          wrote on last edited by
          #4

          Sorry that I didn't make the question clear..

          It looks like QNetworkRequest and QNetworkReply just provide developers an access for http request. Finally QNetworkRequest/QNetworkReply/ need to call system level API for http request. It looks like QNetworkRequest send some signals to the slots of QApplication, and QApplication will call system level API ? But in Qt source code, I cannot find how Qt call System level http request(like windows socket,etc). In src/network/, it still looks like Qt level code ..

          Thanks for any help!!

          1 Reply Last reply
          0
          • H Offline
            H Offline
            huyanke
            wrote on last edited by
            #5

            By the way, mlong, how do you make QNetworkAccessManager linked to its doc?

            [quote author="mlong" date="1305077615"]QNetworkRequest/QNetworkReplys are ultimately handled by a "QNetworkAccessManager":http://doc.qt.nokia.com/4.7/qnetworkaccessmanager.html. Offhand, I'm not sure what system-level API is used internally by that class, though the sources are available.[/quote]

            1 Reply Last reply
            0
            • H Offline
              H Offline
              huyanke
              wrote on last edited by
              #6

              I just find in src/network/socket, there are qnativesocketengine_win.cpp and qnativesocketengine_unix.cpp, they make system level network call.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                goetz
                wrote on last edited by
                #7

                The actual protocol is implemented using the Qt classes - of course! The Trolls eat their own dog food. So, the HTTP classes use QTcpSocket, which in turn is based on the native sockets of the OS.

                It's still unclear what's the intention behind your question. Do you need some special functionality or is it just for education that you want to understand the code?

                http://www.catb.org/~esr/faqs/smart-questions.html

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mlong
                  wrote on last edited by
                  #8

                  I think you may be making some wrong assumptions about the functionality of QApplication. Its job isn't to dispatch native system calls itself. It, among other things, handles the application's main event loop which allows a lot of the messaging and interaction among Qt's classes.

                  [quote author="huyanke" date="1305136760"]By the way, mlong, how do you make QNetworkAccessManager linked to its doc?

                  [/quote]

                  I use the link button at the top of the "Post a reply" box and paste in the URL to the appropriate document. Nothing magic.

                  Edit: Combined 2 thoughts to keep from opening another post.

                  Software Engineer
                  My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved