#include#include int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); QCommandLineParser parser; parser.setApplicationDescription("My Application"); parser.addHelpOption(); parser.process(app); // ... }
Usage: myapplication [options] My Application. Options: -h, --help Displays this help.In this example, the QCommandLineParser is part of the Qt Core module, which is included in the Qt packages.