shahriar25 last edited by shahriar25
I wanted to build a custom progress dialog for my project so I built a dialog with a progressBar in the ui and two public functions:
void setProgressBarValue(int value)
void setProgressBarRange(int min, int max)
And in my project:
myProgressDialog *dialog = new myProgressDialog;
for (int i=0; i<=100; ++i)
And when I run it it shows the dialog but inside the dialog is black until it reaches 100
I know I'm doing everything wrong so can someone tell me how to do it?
Your code doesn't allow for the events to be processed between the calls to
dialog.setProgressBarValue(i);, this is why the first paint event you'll get processed is after the loop finishes. You could manually request events to be processed in the loop by using QCoreApplication::processEvents.
shahriar25 last edited by
Thank you so much. I did it.