Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7410897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:18:13+00:00 2026-05-29T06:18:13+00:00

Hi all I have problem with qprogressbar. How can I make it smooth? I

  • 0

Hi all I have problem with qprogressbar. How can I make it smooth? I want it to go smoothly from 0 to 100% . I am using it with reply variable which reads data from php script and returning me data. I need to wait 3-4 seconds to get my data I want that progressbar to go smoothly from 0 to 100 and I only have instantly from 0-100.

Here is my code:

void MainWindow::updateDataTransferProgress(qint64 bytesReceived, qint64 bytesTotal)
{
    ui->progressBar->setMaximum(bytesTotal);
    ui->progressBar->setValue(bytesReceived);

}

void MainWindow::Citanje_korisnika()
{
    init();

    QUrl params;
        params.addQueryItem("action","Citanje_korisnika");

        QByteArray data;
        data.append(params.toString());
        data.remove(0,1);

        QNetworkRequest request;
        request.setUrl(url);
        request.setHeader(QNetworkRequest::ContentTypeHeader,
        QVariant("application/x-www-form-urlencoded"));

        reply = manager->post(request, data);
        connect(reply, SIGNAL(downloadProgress(qint64, qint64)),this, SLOT(updateDataTransferProgress(qint64,qint64)));

}

If you need more code..just tell me.

EDIT 2:
Here is my another part of code:

void MainWindow::init()
{
    url = "http://127.0.0.1:8888/direkt_php_qt.php";
    manager = new QNetworkAccessManager(this);
   // connect(manager, SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(updateDataTransferProgress(qint64,qint64)));
    connect(manager, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));
}

So program starts and first thing it goes into functionvoid MainWindow::Citanje_korisnika() then it goes to void MainWindow::init() and then void MainWindow::updateDataTransferProgress(qint64 bytesReceived, qint64 bytesTotal) problem is. I want to make this progress bar to go smoothly from the begginig of the program until he downloaded all data to my reply variable.
Now I am getting my form shown and then I waint 3-4 sec nothing is happening, I see my progress bar at 0 and nothing is filled with data and then after some time progress bar jumpes to 100% and data is show.. So I want this perios while program is loading from server to see my progress bar going from 0-100 at some normal speed. Now I only see blank fileds and then boom everything is on. I want to make it all go smoothly. If you know what I mean.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:18:14+00:00Added an answer on May 29, 2026 at 6:18 am

    Looks like here the bytesReceived == bytesTotal and thats why its jumping from 0 to 100% immediately. If you know approximate size of bytesTotal you can set QNetworkReply::setReadBufferSize(qint64 size) to fraction of bytesTotal. Than at least you will some progress. However as mentioned in the docu this will throttle down your download speed and I see no point in that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi all i have a problem i want to make the UI thread to
I have problem with return statment >.< I want to store all magazine names
I have a problem where I need to remove all code and triggers from
I have problem in which I have some rows which I want there to
Hi all I have a problem with accessing an HashMap into my jsl using
all i have a problem in trying to using jquery and css3 keyframe to
i have problem with autorotate on iphone i set up in all classes -
Here is the problem: We have all of our development under subversion, but our
I have a problem after i setup windows 7 all old projects in c#
I have the problem, that PHP replaces all spaces with underscores in POST and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.