Coder Social home page Coder Social logo

qt-qtconsole's Introduction

QtConsole widget

The QtConsole class is a custom widget that implements a basic console, completely written in C++ and relying on Qt 5. It implements several features and is intended to be inherited from in order to have a "real" console for a specific scripting language, shell, etc... The class relies as much as possible on the features offered by QTextEdit (from which it inherits) and this implied a very simple and light code.

Features

  • QConsole is a custom widget that can be easily integrated in any interface. It is able to execute any command (implementated in child classes) and then displays its result in blue or red whether it has failed or not. It also displays the stdout/stderr output produced by these commands with the same colorization schema.

  • QConsole supports multi-line commands. In fact, when an incomplete command (e.g., unclosed braces) is validated, the cursor is set at the beginning of a new line.

  • QConsole supports specifying a different prompt.

  • Navigation:

    • Left and right keys to move the cursor in the edition zone (from the prompt to the end of the paragraph plus all the extra lines in multi-line command mode).

    • Associated with the shift key, selection is then possible.

    • Associated with ctrl key, the cursor is moved between the words.

    • Ctrl and shift keys can be used together.

    • If not in multi-line mode, up and down keys permit the user to navigate in the commands' history as with advanced shells, otherwise they permit to navigate in the edition zone.

    • Home and end keys allow moving the cursor respectively just after the prompt and at the end of the current line.

    • Associated with the shift key, selection is then possible.

  • Edition:

    • Simple key strokes work as expected and the 'enter' will place the command into the history list, validate it and 'execute' it giving us back the result (this is in case the command is complete, otherwise the cursor will move to a new line).

    • Pressing Ctrl + C key sequence will cancel the current command and shows the prompt again.

    • Pressing the Tab key will try to autocomplete the current command. If there are many possibilities, they should be all shown.

    • The Delete and Backspace keys will delete selected text or simply one character in the limits of the edition zone. The ctrl key can be associated with them to delete whole words.

    • Copy & Paste are always enabled, but Cut is only possible in the edition zone.

  • Mouse usage:

    • If the cursor is not placed in the edition zone, its position is undone.

    • Selection using the mouse is possible everywhere.

AUTHORS:

qt-qtconsole's People

Contributors

uglide avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.