QProgressBar
-
I am new to QT...
I am trying to create an application which reads some data from the database... while retreving the data i want to show the progress bar.
Since i don't know how much amount of time will application take for retreving the data, so i m using the following code for creating busy progress bar.
@static int count;
progressbar = new QProgressBar(this);
@on the START button click event i m setting
@progressBar->setMinimum(0);
progressBar->setMaximum(0);
progressBar->setValue(++count);@If user wants to stop the process in between i have given a CANCEL button
on the CANCEL button click event i m setting@progressBar->reset();@
But if I click on CANCEL button, the progress bar keeps on running, it doesn't reset.
Please let me know if i m missing something here.
[Edit: Code highlighting / Vass]
-
I used the following code:
@void MainWindow::on_Start_Button_clicked()
{
progressBar->setMaximum(100);
progressBar->setValue(0);
}void MainWindow::on_Stop_Button_clicked()
{
progressBar->reset();
}@It show the progess as 0% constantly.
Please let me know what is wrong with the code. -
Hi....
I don't know how much time will my application take for retreving the data, so in that case i m using the busy progressbar by setting maximum/minimum to 0/0.@void MainWindow::on_Start_Button_clicked()
{
static int count = 0;
progressBar->setMaximum(0);
progressBar->setMinimum(0);
progressBar->setValue(count++);
}
void MainWindow::on_Stop_Button_clicked()
{
progressBar->reset();
}@This shows me the busy progress bar, but if i click on Stop button the progress bar is not getting reset. Please let me know do i need to do anything else for resetting the progress bar.