How to make inprocess or progressbar in console app
Unsolved
General and Desktop
-
Hi
There are various ways
https://stackoverflow.com/questions/28350254/how-do-i-rewrite-a-line-of-text-in-a-console-project-c -
You can do it with something like:
for(unsigned short int i = 0; i <= 100; i++) { std::cout << QString("\rProgress: %1").arg( i < 100 ? QString("%1%").arg(i) : "Done" ).toStdString() << std::flush; std::this_thread::sleep_for(std::chrono::milliseconds(50)); }
Libraries needed to run this example:
iostream
,thread
andchrono