As a test (and only a test) try putting this in after you increment the progress value:
MessageManager::getInstance()->runDispatchLoopUntil (200);
Rail
As a test (and only a test) try putting this in after you increment the progress value:
MessageManager::getInstance()->runDispatchLoopUntil (200);
Rail
The problem is you probably have not initialized āprogress = 0ā. Then youāre adding values to āprogressā in the run() but until āprogressā reaches 1% you will wait for eternity.
Edit: Ah, sorry, I see itās in the constructor. Iāve got almost identical code in my apps and it works perfectly fine.
progress += i / j;
maybe you meant
progress = i / j;
Shouldnāt i be converted to float first before dividing? Otherwise it will return 0 al the time. Or am I wrong here?
Edit: sorry, j is double so never mind
Personally Iād have written it with an explicit cast to double, just to make sure thatās clear to a reader, e.g.
progress = currentItem / (double) totalNumItems;
I think it was clear to reader, i was testing with hardcoded values also.
MessageManager::getInstance()->runDispatchLoopUntil (200);
works for testing in simple loop, but returns assertion when running in thread as it is not a Message thread.