How can I emulate a shell scripting environment using QTextEdit?
[Goal]
A simple command line prompt with QTextEdit
or any other suitable Qt way.
(used QScriptEngine
as an ECMA script interpreter)
[Example]
MATLAB
Python
On the command line, part of the command line is editable and the rest are not. For MATLAB, only the line after the last one is available >>
; only the line after the last is available to the Python shell >>>
.
[Bypass]
This is the first thought that pops into my head:
Using QTextEdit
both read-only and QLineEdit
as a command. For pure functionality, this is acceptable, but not sufficient.
[Question]
Actually the same question can be found here: Implementing a GUI wrapper in qt and the accepted answer is the same as this workaround. As I said, the workaround isn't enough. I'm wondering if it is possible to emulate the command line with Qt? QTextEdit
Seems to be the best senior class currently .
Any ideas are appreciated. Codes are welcome but not needed, all I need are some hints and directions.
source to share