Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. How to add "new line " to QString ?

How to add "new line " to QString ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
5 Posts 4 Posters 746 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    I like to add new line into QString "text" passed to qDebug.
    Using text += "\n" or "/n" does not work.

        text += " ******************";
       **text  +=   new line   ???** 
        qDebug()<<text;
    
    JonBJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      I like to add new line into QString "text" passed to qDebug.
      Using text += "\n" or "/n" does not work.

          text += " ******************";
         **text  +=   new line   ???** 
          qDebug()<<text;
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @AnneRanch
      Try:

      qDebug().noquote() << "First line\nSecond line";
      
      A 1 Reply Last reply
      3
      • JonBJ JonB

        @AnneRanch
        Try:

        qDebug().noquote() << "First line\nSecond line";
        
        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by Anonymous_Banned275
        #3

        @JonB said in How to add "new line " to QString ?:

        qDebug().noquote() << "First line\nSecond line";

        Thanks, works as expected.

        Axel SpoerlA 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @JonB said in How to add "new line " to QString ?:

          qDebug().noquote() << "First line\nSecond line";

          Thanks, works as expected.

          Axel SpoerlA Offline
          Axel SpoerlA Offline
          Axel Spoerl
          Moderators
          wrote on last edited by
          #4

          @AnneRanch
          Mark this thread as solved then!

          Software Engineer
          The Qt Company, Oslo

          1 Reply Last reply
          0
          • K Offline
            K Offline
            K Himaja
            wrote on last edited by
            #5

            QString myString = "First line\nSecond line"

            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