Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to get Transfer rate when downloading file
QtWS25 Last Chance

how to get Transfer rate when downloading file

Scheduled Pinned Locked Moved Solved General and Desktop
qnetworkaccessmqnetworkreplytransfer rate
4 Posts 3 Posters 1.3k 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.
  • A Offline
    A Offline
    ARASHz4
    wrote on 12 May 2016, 14:03 last edited by
    #1

    Hi
    I want to get transfer rate when downloading a file
    in use QNetworkAccessManager , QNetworkReply

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 12 May 2016, 14:22 last edited by
      #2

      Use a QTimer to count the interval between two QNetworkReply::readyRead() signals then take QNetworkReply::bytesAvailable() divide by 8 times (1 byte=8bits) the timer value (in seconds) and then adjust for the magnitude ( divide by 1024 for kb, by 1048576 for Mbps or 1073741824 for Gbps)

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      T 1 Reply Last reply 12 May 2016, 14:38
      3
      • V VRonin
        12 May 2016, 14:22

        Use a QTimer to count the interval between two QNetworkReply::readyRead() signals then take QNetworkReply::bytesAvailable() divide by 8 times (1 byte=8bits) the timer value (in seconds) and then adjust for the magnitude ( divide by 1024 for kb, by 1048576 for Mbps or 1073741824 for Gbps)

        T Offline
        T Offline
        the_
        wrote on 12 May 2016, 14:38 last edited by
        #3

        @VRonin

        as 1 byte is 8 bits it should be 8times QNetworkReply::bytesAvailable() divided by the timver value to get bits/second iirc :)

        -- No support in PM --

        V 1 Reply Last reply 13 May 2016, 07:38
        2
        • T the_
          12 May 2016, 14:38

          @VRonin

          as 1 byte is 8 bits it should be 8times QNetworkReply::bytesAvailable() divided by the timver value to get bits/second iirc :)

          V Offline
          V Offline
          VRonin
          wrote on 13 May 2016, 07:38 last edited by
          #4

          @the_ I can't even math anymore. thanks for the correction

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          0

          4/4

          13 May 2016, 07:38

          • Login

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