ProgressBar in MainLoop?

Is there a easy way to implement a PogressBar in MainLoop ( process?

You know the answer, don’t you?

The only way I see ain’t easy.

  1. Start a
  2. MainLoop writes data to file
  3. shows dialog, writes to file if Stopp-Button pressed
  4. MainLoop reads file
  5. Goto 2 until done

Running in Thread is no option, speed to slow.

I can think about three ways:

  1. doing work on main thread, calling refresh and update now to have progress dialog redraw. (bad)
  2. running a timer to do work with a small delay like 10ms and have it process one item at a time and move progress bar (better)
  3. running a thread to work items and set property with current value. Timer updates progress dialog once a second to newer value.

That is by far the best solution :slight_smile:

1 Like

It always depends on the things you do.
But the timer doing one at a time is a good thing if processing can’t run in a thread.

do the job. Thanks for help.