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

Widget required

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 690 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.
  • C Offline
    C Offline
    Colins2
    wrote on last edited by Colins2
    #1

    Hi All,

    Just a simple query (I hope).
    I've been searching for a textbox of some sort that I can display messages as the program runs.
    These are information messages, the sort that might go in a log file.
    C++ Builder has Memopad which is very useful but I can't find an equivalent in Qt.

    I guess I could use the texteditor widget but that seems to be overkill for what I want which is purely a display that I can add lines to when I want.

    Any help appreciated.

    BTW, I have searched on the forums and in the Qt documentation but can't find anything.

    jsulmJ 1 Reply Last reply
    0
    • C Colins2

      Hi All,

      Just a simple query (I hope).
      I've been searching for a textbox of some sort that I can display messages as the program runs.
      These are information messages, the sort that might go in a log file.
      C++ Builder has Memopad which is very useful but I can't find an equivalent in Qt.

      I guess I could use the texteditor widget but that seems to be overkill for what I want which is purely a display that I can add lines to when I want.

      Any help appreciated.

      BTW, I have searched on the forums and in the Qt documentation but can't find anything.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Colins2 https://doc.qt.io/qt-5/qplaintextedit.html is lighter than QTextEdit

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        For big log files, maybe a ListView+model works better ?
        QPlainTextEdit is much like MemoPad however, it will copy the text to its internal buffer so it becomes heavy with thousands of lines.

        C 1 Reply Last reply
        1
        • mrjjM mrjj

          Hi
          For big log files, maybe a ListView+model works better ?
          QPlainTextEdit is much like MemoPad however, it will copy the text to its internal buffer so it becomes heavy with thousands of lines.

          C Offline
          C Offline
          Colins2
          wrote on last edited by
          #4

          @mrjj

          Thanks for the suggestions.
          I looked at both of these, although not in any great detail but they didn't seem to be what I was looking for.
          Maybe the QPlainTextEdit will work, I don't anticipate thousands of lines.
          Oh how easy MemoPad is: memo1->lines.add(string) :-)
          I was surprised that there wasn't something similar in Qt.

          jsulmJ mrjjM 2 Replies Last reply
          0
          • C Colins2

            @mrjj

            Thanks for the suggestions.
            I looked at both of these, although not in any great detail but they didn't seem to be what I was looking for.
            Maybe the QPlainTextEdit will work, I don't anticipate thousands of lines.
            Oh how easy MemoPad is: memo1->lines.add(string) :-)
            I was surprised that there wasn't something similar in Qt.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Colins2 You can append text using https://doc.qt.io/qt-5/qplaintextedit.html#appendPlainText

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            C 1 Reply Last reply
            1
            • C Colins2

              @mrjj

              Thanks for the suggestions.
              I looked at both of these, although not in any great detail but they didn't seem to be what I was looking for.
              Maybe the QPlainTextEdit will work, I don't anticipate thousands of lines.
              Oh how easy MemoPad is: memo1->lines.add(string) :-)
              I was surprised that there wasn't something similar in Qt.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Colins2

              well that is surely as easy a MemoPad :)

              ui->logText->appendPlainText(string);

              Note:
              Disable the undo buffer
              https://doc.qt.io/qt-5/qplaintextedit.html#undoRedoEnabled-prop
              its default true and no reason to make copy of its structure when used for "logging"
              (IMHO)

              1 Reply Last reply
              1
              • jsulmJ jsulm

                @Colins2 You can append text using https://doc.qt.io/qt-5/qplaintextedit.html#appendPlainText

                C Offline
                C Offline
                Colins2
                wrote on last edited by
                #7

                @jsulm @mrjj

                Thanks for both answers I will try them out.

                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