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?
Forum Updated to NodeBB v4.3 + New Features

Remove qDebug() newline?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 11.4k 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 23 Oct 2012, 21:38 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 23 Oct 2012, 22:11 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 23 Oct 2012, 23:06 last edited by
        #3

        thanks a million.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Macro
          wrote on 24 Oct 2012, 05:30 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

          1/4

          23 Oct 2012, 21:38

          • Login

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