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. A gap between QNetworkReply::finished signal and QNetworkReply::uploadProgress
Forum Updated to NodeBB v4.3 + New Features

A gap between QNetworkReply::finished signal and QNetworkReply::uploadProgress

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 331 Views 1 Watching
  • 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.
  • N Offline
    N Offline
    nnzz
    wrote on last edited by
    #1

    Hi, I'm presenting a progress dialog while uploading content to the server,
    but I stop recieving the QNetworkReply::uploadProgress signal a few seconds before I recieve the QNetworkReply::finished signal.
    Why is that? here is my code:

    QHttpMultiPart* pUploadData = new QHttpMultiPart(QHttpMultiPart::FormDataType, this);
    QFile* pFile = new QFile(fileName);
    pFile->open(QIODevice::ReadOnly);
    QHttpPart jsonPart;
    jsonPart.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/json"));
    jsonPart.setHeader(QNetworkRequest::ContentDispositionHeader, QStringLiteral("form-data; name=\"%1\"").arg(fileName);
    jsonPart.setBodyDevice(pFile);
    pFile->setParent(pUploadData);
    pUploadData->append(jsonPart);
    m_netRequest.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"text\""));
    m_netRequest.setRawHeader(QLatin1Literal("Accept").data(), QLatin1Literal("text/plain").data());
    m_netRequest.setUrl(url);
    m_pUploadReply = m_netManager.post(m_netRequest, pUploadData);
    connect(&m_netManager, &QNetworkAccessManager::finished, this, &FeedbackConnectionManager::OnUploadFinished);
    connect(m_pUploadReply, &QNetworkReply::uploadProgress, m_pProgress, &ProgressDialog::networkUploadProgress);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What is the size of the data ?

      Did you check with a tool like WireShark whether there was still network activities after the progress update stops ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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