A long awaited feature is available with the release of Qt 5.2.1: a command line parser, so for applications that need to accept command line options, a cross platform solution is finally available as part of the Qt framework itself, say good bye to relying on third parties libraries (for instance QtArg just to mention any of them).
We must be thankful to KDE developer David Faure and the help from Qt, as command line parsing support is based on similar code developed for the KDE project being a clear example of what is happening with several other modules that will migrate from the KDE Frameworks libraries into Qt.
You can follow this very nice introduction to the basics of QCommandLineParser, along with a complete example (including source code for you to try) provided by Jeff Tranter from ICS. And of course, you have the complete documentation from Digia as we're so far used to.
Happy coding and command line processing! (-v --help)
Monday, February 24, 2014
QCommandLineParser: an integrated way to treat command line options, new in Qt 5.2
Labels:
5.2,
arguments,
command line,
CommandLineParser,
help,
options,
parser,
QCommandLineOption,
Qt,
QtArg,
version
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment