Embedded Console in Qt GUI
-
Maybe a QPlainText? You could overload keyPressEvent() to make it behave more like a terminal.
-
Maybe you can take a look at this files:
http://code.google.com/p/ninja-ide/source/browse/ninja_ide/gui/misc/console_widget.py
http://code.google.com/p/ninja-ide/source/browse/ninja_ide/tools/console.pyUsing that I wrote a Python Console, maybe you can use something like that and send commands to the OS and print the answer in that QPlainTextEdit.
You can see at the ConsoleWidget Class how to handle history and avoid to let the user modify everywhere in the QPlainTextEdit, to behave as a console.
Regards
-
Please take look at this open source project:
http://sourceforge.net/projects/qconsole
It's a Qt / C++ console widget, currently supporting TCL and Python languages but it is completely extensible...
-
[quote author="Peppy" date="1346602509"]I am working on that too, everything you need it's just to handle position of cursor inside of keyPressEvent.[/quote]
It's indeed an important part but you quickly realize that more and more features must be added : Just take a look at QConsole code and try it...
-
This one is quite fancy:
"https://github.com/kmatheussen/radium/blob/master/Qt/Qt_ReqType.cpp":https://github.com/kmatheussen/radium/blob/master/Qt/Qt_ReqType.cppIt uses a label to display output text and opens a new QLineEdit widget for each input line.
-
[quote author="Peppy" date="1346609672"]@Houssem:
No thanks, it's under GPL, I won't use that due to license infringements.[/quote]I've just changed it to LGPL v2, as Qt licence !
Please let me know if this is sufficient or more things need to be done... -
There is QTermWidget
https://github.com/zester/Quantum/tree/master/QTermWidgetHere is an example application using it.
https://github.com/zester/Quantum/tree/master/QTerminal