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. Need a Terminal Like widget usable from Python
Forum Updated to NodeBB v4.3 + New Features

Need a Terminal Like widget usable from Python

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 271 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.
  • T Offline
    T Offline
    TonySuffolk
    wrote on last edited by
    #1

    I am writing an application where part of one of the window is a 'terminal' - where each new line typed is sent to a custom class, and the 'output' is collected from this class (this class is effectively a wrapper around a REST API to a remote service. I am using PySide6.

    I could do a simple display widget and a separate 'entry line widget' underneath it, but i would prefer to have a single seamless widget, to allow terminal like scrolling, copy/paste etc.

    My initial thought was to use QPlainTextEdit but i am struggling on a number of things :

    1. restricting input just to the end of the text - in a terminal you can't simply type anywhere you want.
    2. capturing the new text that is typed when the return is pressed.

    Does anyone have any examples in Python that uses QPlainTextEdit - or a 3rd party widget with Python biindings

    JonBJ 1 Reply Last reply
    0
    • T TonySuffolk

      I am writing an application where part of one of the window is a 'terminal' - where each new line typed is sent to a custom class, and the 'output' is collected from this class (this class is effectively a wrapper around a REST API to a remote service. I am using PySide6.

      I could do a simple display widget and a separate 'entry line widget' underneath it, but i would prefer to have a single seamless widget, to allow terminal like scrolling, copy/paste etc.

      My initial thought was to use QPlainTextEdit but i am struggling on a number of things :

      1. restricting input just to the end of the text - in a terminal you can't simply type anywhere you want.
      2. capturing the new text that is typed when the return is pressed.

      Does anyone have any examples in Python that uses QPlainTextEdit - or a 3rd party widget with Python biindings

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

      @TonySuffolk
      Struggling to find this for Python. You might have a look at really simple https://gist.github.com/ssokolow/6f93e68d2af774aebf18667a7760cd23? Remove the bits which run a subprocess and replace with your own output. It might be useful just to show how it handles the input and scrolling in a QTextEdit/QPlainTextEdit?

      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