QConsole

Description

The QConsole class is a custom widget that implements a basic console, completely written in C++ and relying on Qt (both 3.x & 4.x). 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.

QtclConsole inherits from QConsole and emulates a TCL shell in a Qt application. So basically, the user is able to execute any TCL built-in command and also any other user-defined commands created using the TCL C-API. These commands should represent all the features of a given application, so the user will be able to execute them using the GUI and also in the embedded TCL shell. This is very useful in the EDA (Electronic Design Automation) field where most of the tools are using TCL scripting and Qt as well.

This application shows how to embed the QtclConsole widget in a main window. It is composed of the base custom widget (qconsole.h, qconsole.cpp), the Tcl implementation (qtclconsole.h, qtconsole.cpp), some custom Tcl commands (commands.h and commands.cpp), the commands class manager (commandsManager.h and commandsManager.cpp), the stdout/stderr interceptor class (interceptor.h and interceptor.cpp) and the main.cpp file.

Features

QtclConsole specific features

QpyConsole specific features