Important: Please read the Qt Code of Conduct -

How to create Qt GUI app based on Linux command line tools

  • Hello everyone,

    I am new to Qt and programming, and I have a project that requires me to build an app that can scan wireless networks, list those networks, and connect to a selected network. My idea is to build a Qt-based GUI that calls on Linux command line tools like iw, ping, dhclient and wpa_supplicant. So instead of a user typing into the terminal, a user would just click a "scan" button, and connect to the desired network by clicking on a "connect" button.

    I researched on possible Qt classes and found QProcess can be used to take commands from the terminal. But I also read about a new class called QCommandLineParser, though I don't quite understand how to use it. Can anyone help me to understand how to build this project? I also know of existing tools like connman and the native Network Manager, but I do not know any Qt-based versions of those programs that I can use. I would greatly appreciate it if anyone can point me in the right direction.


  • Moderators


    QCommandLineParser is completely different from QProcess. It is a convenience class to ease the command line parsing if you are creating a Qt Console application (i.e non gui).
    Since you want to create Qt GUI application and want those external command line tools to be executed from the application then QProcess is exactly what you need.

  • Thank you for this p3c0! I needed some clarification about QProcess and QCommandLineParser. Now I only need to focus on QProcess.

Log in to reply