Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to overwrite in a console Application
Hey guys, I have a little problem which is I’m updating my output every 50 ms but I don't want the output to display several times, but just want to directly rectify the given display.
but I don't want the output to display several times
What do you mean?
Please explain better what exactly you want and what you get.
There is little console/cursor control in plain c++.
You could use ncurses or Termbox or anything similar.
The most robust way to do what you want would be to use the ncurses library.
Otherwise, this stack overflow answer looks pretty good (not tested myself, but the logic looks correct).
@jsulm i would like to have something similar to this picture:
The output is displayed once this is because i'm calling my function just one time. now if i want to call the same function several of time to update the output but without displaying that more than one time
see Picture bellow
Zac.Boussaid last edited by Zac.Boussaid
@SGaist i'm using qDebug() , not cout. I tried to use flush but i didn't get what i want. i tried even to give my output with cout but suddenly i get the smae thing
JonB last edited by JonB
The simple answer is I don't think you can do this. @SGaist's stackoverflow post does what I thought of, which is emit
\rcarriage-returns to move the cursor back to the start of a line to overwrite. But that would only work for one line, and what you want is to "back up" 8 lines each time, and I don't know of any way to do that. Other than @SGaist's suggestion of
ncurses, which is a whole different ball-game.
@JonB thank you for your answer, At least i have an idea now