Search code examples
c++qtqtguiqprocessqplaintextedit

How to insert a command line to GUI applications


I need to make a QT GUI application that will be able to run the command line batchs and commands. For example, ping, tcpdump, etc. ...

I would imagine it like this: The standard graphical window with the QTableView, some checkboxes, etc. ... with a component instance QPlainTextEdit. This component (QPlainTextEdit) will act as a command line, that will allow to enter commands and capture their output.

Is such a thing possible? How should this be done?


Solution

  • You can use QProcess for your purpose..

    QProcess cmd;
    cmd.start("cmd");
    

    More details here..

    http://www.qtcentre.org/threads/12757-QProcess-cmd