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. Remove qDebug() newline?
Qt 6.11 is out! See what's new in the release blog

Remove qDebug() newline?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 12.0k Views 1 Watching
  • 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.
  • U Offline
    U Offline
    u2gilles
    wrote on last edited by
    #1

    Hi All, is it possible to have qDebug() not append the newline?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      The output is emitted and end-of-line added when the QDebug object is destroyed. The typical usage pattern creates a temporary QDebug object that is used and destroyed immediately. Control its scope to control when it outputs:
      @
      QDebug dbg(QtDebugMsg);

      dbg << "One";
      dbg << "Two";
      @

      1 Reply Last reply
      1
      • U Offline
        U Offline
        u2gilles
        wrote on last edited by
        #3

        thanks a million.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Macro
          wrote on last edited by
          #4

          [quote author="ChrisW67" date="1351030309"]The output is emitted and end-of-line added when the QDebug object is destroyed. The typical usage pattern creates a temporary QDebug object that is used and destroyed immediately. Control its scope to control when it outputs:
          @
          QDebug dbg(QtDebugMsg);

          dbg << "One";
          dbg << "Two";
          @[/quote]

          Woww..!! This is new for me... Thanks a Lot... hope will learn some more new things like this.. :)

          1 Reply Last reply
          0

          • Login

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