Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. \r doesn't work on qdebug. what can i do to use \r in qdebug?
Forum Update on Monday, May 27th 2025

\r doesn't work on qdebug. what can i do to use \r in qdebug?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 256 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    warning
    wrote on last edited by
    #1
        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

    JonBJ 1 Reply Last reply
    0
    • W warning
          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

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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 a printf() rather than qDebug() 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).

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved