Hi,
I just copied the content of your ex() function and stuck it in the main() of a test application.
It ran as expected with a progress bar incrementing the text value and the bar position.
So unfortunately there's not much I can say about why it's not working.
In terms of architecture though, it would be best not to have the wasCancelled() test inside you for loop. I stuck a message box in this test, but as soon as I clicked ok the loop continued, then the progress bar was still cancelled, so the messagebox kept being displayed.
This would be a better construct:
for (long row = 0; row < RowCount && !progress.wasCanceled(); ++row)
{
progress.setValue(row);
}
if(progress.wasCanceled())
{
}
for (long row = 0; row < RowCount && !progress.wasCanceled(); ++row)
{
progress.setValue(row);
}
if(progress.wasCanceled())
{
QMessageBox::information(0, "Hi", "there", "OK");
}
To copy to clipboard, switch view to plain text mode
Also, I left off qApp->processEvents(); and it worked fine, maybe that's causing an issue on your system?
Steve York
Bookmarks