\r doesn't work on qdebug. what can i do to use \r in qdebug?
Unsolved
General and Desktop
-
int i = 0; while (i++ < 10000) { //printf("\r i = %d", i); // i want this //qDebug("\033[0K %d",i); //no //qDebug("\033[2K i = %d",i); //no //qDebug("i = %d \r",i); //no //qDebug("i = %d \r",i); //no }
Thanks
@warning
Hello and welcome.qDebug()
sends diagnostic messages. You should not use it for the kind of "terminal escape sequences" you are trying to send. You do not even say anything about where/how you are running this? From Qt Creator? With it opening its own terminal window or using the "Application Output" pane, or what? Anyway, use say aprintf()
rather thanqDebug()
if you want to send this kind of escape sequence to a terminal (but won't work in the inbuilt "Application Output" console pane in Creator).