thae
4th November 2006, 04:27
I have a function
void ex
{
long num = 100000;
for(int i=0;i<num;i++)
{
// do something
}
}
In the mainWindow when I call this function
I want to have a progress bar that indicates this function is running
I've used these code
void ex()
{
long RowCount = 60000;
QProgressDialog progress(this);
progress.setLabelText("ProgressBar");
progress.setRange(0, RowCount);
progress.setModal(true);
progress.show();
for (long row = 0; row < RowCount; ++row) {
progress.setValue(row);
qApp->processEvents();
if (progress.wasCanceled()) {
}
}
}
But the progress bar isn't running except it's increasing percentage
( it shows up but not progressing )
can't you help me !
thanks in advance !
void ex
{
long num = 100000;
for(int i=0;i<num;i++)
{
// do something
}
}
In the mainWindow when I call this function
I want to have a progress bar that indicates this function is running
I've used these code
void ex()
{
long RowCount = 60000;
QProgressDialog progress(this);
progress.setLabelText("ProgressBar");
progress.setRange(0, RowCount);
progress.setModal(true);
progress.show();
for (long row = 0; row < RowCount; ++row) {
progress.setValue(row);
qApp->processEvents();
if (progress.wasCanceled()) {
}
}
}
But the progress bar isn't running except it's increasing percentage
( it shows up but not progressing )
can't you help me !
thanks in advance !