Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Creating interface for terminal
Forum Updated to NodeBB v4.3 + New Features

Creating interface for terminal

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 306 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.
  • P Offline
    P Offline
    pingal
    wrote on last edited by pingal
    #1

    I've a client server app in which the server side can interact with the /bin/sh of client side. I've build and tested the client side and now client can receive & process /bin/sh commands and sends back the output.

    On server side, I have created a naive interface which will mimic the client terminal interface somehow. The interface seems like the below (for now)

    Capture.PNG

    I've used TextInput for input of commands.

    I've these questions in mind:

    1. Which element should I use for the output window ?

    2. When I press enter after input command, the command should appear in the output window.

    3. The corresponding receive text (from the client) should appear after the command in the output window.

    4. Output window should automatically slide if the text fills the windows just like terminal/cmd.

    I'm new to GUI/QML so ignore my ignorance.

    Any guidance/help would be appreciated.

    Thanks

    jsulmJ 1 Reply Last reply
    0
    • P pingal

      I've a client server app in which the server side can interact with the /bin/sh of client side. I've build and tested the client side and now client can receive & process /bin/sh commands and sends back the output.

      On server side, I have created a naive interface which will mimic the client terminal interface somehow. The interface seems like the below (for now)

      Capture.PNG

      I've used TextInput for input of commands.

      I've these questions in mind:

      1. Which element should I use for the output window ?

      2. When I press enter after input command, the command should appear in the output window.

      3. The corresponding receive text (from the client) should appear after the command in the output window.

      4. Output window should automatically slide if the text fills the windows just like terminal/cmd.

      I'm new to GUI/QML so ignore my ignorance.

      Any guidance/help would be appreciated.

      Thanks

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

      @pingal

      1. QTextEdit in read-only mode
      2. Just append it to the QTextEdit
      3. Same as 2 but for the text you receive
      4. Do you mean scroll? It is already there in QTextEdit

      Oh, just realized you're asking about QML - forget my reply :-)

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

      1 Reply Last reply
      1
      • P Offline
        P Offline
        pingal
        wrote on last edited by pingal
        #3

        In QML, i'm using ScrollView along the TextArea to view the input commands and output.

        I'm facing two problems here:

        1. The TextArea doesn't scroll down automatically, i want the ScrollView to show me the latest output so that i doesn't have to scroll down manually to see it.

        2. I'm unable to change the TextArea background color. The background I want to be transparent so that it reflects the main windows background.

        ScrollView {
                    id: view
                    anchors.fill: parent
        
                    TextArea {
                        id: outputTxt
                        color: "black"
                        readOnly: true
                        selectByMouse: true
                        text: "TextArea\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n"
                        anchors.fill: parent
                    }
                }
        

        Capture.PNG

        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