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. append text two different interpretations
Forum Updated to NodeBB v4.3 + New Features

append text two different interpretations

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 5 Posters 423 Views 3 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Both QText and QPlainTextEdit have methods to " append ( text)"
    However QText appends to the existing text and QPlainTextEdit
    creates new text and , in my case, adds new line to the widget.

    I have copied / using 3rd party files using BOTH classes, hence , appending - as adding new line of text - is not the same procedure.

    This is NOT A BIG issue , I can change the classes.

    I was just curious if there is an way to make QText behave same as QPlainTextEdit - append new line instead of appending to existing text.

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I neither know QText nor has QPlainTextEdit a function named 'append()'.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      artwawA 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        I neither know QText nor has QPlainTextEdit a function named 'append()'.

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by artwaw
        #3

        @Christian-Ehrlicher Apparently, QTextEdit has a method with that name.
        And it works as intended (or at least - as described in the docs): it adds new paragraph. So that includes newline.

        But I could not find (nor I ever heard of) QText. QPlainTextEdit also doesn't have that method.

        If OP has QString in mind though, its append() method adds to the string as it is supposed. So, both work as intended.

        For more information please re-read.

        Kind Regards,
        Artur

        JonBJ 1 Reply Last reply
        0
        • artwawA artwaw

          @Christian-Ehrlicher Apparently, QTextEdit has a method with that name.
          And it works as intended (or at least - as described in the docs): it adds new paragraph. So that includes newline.

          But I could not find (nor I ever heard of) QText. QPlainTextEdit also doesn't have that method.

          If OP has QString in mind though, its append() method adds to the string as it is supposed. So, both work as intended.

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

          @artwaw
          QPlainTextEdit has both appendHtml() & appendPlainText(). All the methods discussed are for adding a "paragraph". How this relates to whatever the question is I do not know.

          1 Reply Last reply
          0
          • Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #5

            Probably QText means QTextEdit... and it has an append(QString)-function as well :)


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            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