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. Can I implement a console like Text area in a GUI?
QtWS25 Last Chance

Can I implement a console like Text area in a GUI?

Scheduled Pinned Locked Moved C++ Gurus
8 Posts 2 Posters 4.8k 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.
  • S Offline
    S Offline
    StephenHog
    wrote on last edited by
    #1

    I'm totally new to Qt and C++ so please forgive the noobiness. What I'm trying to do for a project is put a text area in a GUIwith buttons that dictate movement eg. North. Is there a way to create a Text Area that I can put input into and have that inside a GUI? I think using a TextEdit or TextBrowser would be best but I don't know if it's doable. Will I have to use the console and have the GUI buttons separate?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Your description is not really clear. Looks like a QTextEdit with some QPushButton if you take the widget option. In QML it would be a TextEdit and Buttons.

      So all in all, yes you can easily write a GUI with a text edit control and some button.

      Maybe with some more details, a more accurate answer could be given.

      On a side note, it's Qt, QT stands for Apple QuickTime which you could also be using.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        StephenHog
        wrote on last edited by
        #3

        Hey thanks for the reply.

        This is what I'm trying to do:
        http://imgur.com/NmSEe5x

        Since my project is based on Zork, I'd like to load up a generic greeting in the textEdit field and then push north to go north etc.

        So what your saying is if I use QTextEdit, I can put input into the text edit field and receive output into the text edit field after pushing the GUI buttons?

        I've been looking at some of it and does the TextEdit have to be const?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Before going any further, you should first take a look at Qt's tutorials and examples. You'll have a better understanding of what you can do with widgets.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            StephenHog
            wrote on last edited by
            #5

            I have had a look at them and they're confusing the crap outta me. Since I can find no example's of textEdit online that doesn't involve reading in from a file, I'm just going to have to struggle on

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Did you took a look at the documentation that comes with Qt ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                StephenHog
                wrote on last edited by
                #7

                Yes, I really don't think Qt is very user friendly to beginners

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  QTextEdit as a "display widget":http://qt-project.org/doc/qt-5/qtextedit.html#using-qtextedit-as-a-display-widget

                  setText and append are your friends

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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