Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcommandlineparser.cpp
Go to the documentation of this file.
1// Copyright (C) 2013 Laszlo Papp <lpapp@kde.org>
2// Copyright (C) 2013 David Faure <faure@kde.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
6
7#include <qcoreapplication.h>
8#include <private/qcoreapplication_p.h>
9#include <qhash.h>
10#include <qvarlengtharray.h>
11#include <qlist.h>
12#include <qdebug.h>
13#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
14# include <qt_windows.h>
15#endif
16#include <stdio.h>
17#include <stdlib.h>
18
20
21using namespace Qt::StringLiterals;
22
23extern void Q_CORE_EXPORT qt_call_post_routines();
24
25typedef QHash<QString, qsizetype> NameHash_t;
26
28{
29public:
37
38 bool parse(const QStringList &args);
39 void checkParsed(const char *method);
40 QStringList aliases(const QString &name) const;
41 QString helpText(bool includeQtOptions) const;
42 bool registerFoundOption(const QString &optionName);
43 bool parseOptionValue(const QString &optionName, const QString &argument,
44 QStringList::const_iterator *argumentIterator,
45 QStringList::const_iterator argsEnd);
46 Q_NORETURN void showHelp(int exitCode, bool includeQtOptions);
47
50
52 QList<QCommandLineOption> commandLineOptionList;
53
56
58 QHash<qsizetype, QStringList> optionValuesHash;
59
62
65
68
71
79 QList<PositionalArgumentDefinition> positionalArgumentDefinitions;
80
83
86
89
92
95};
97
99{
101 if (it == nameHash.cend()) {
102 qWarning("QCommandLineParser: option not defined: \"%ls\"", qUtf16Printable(optionName));
103 return QStringList();
104 }
105 return commandLineOptionList.at(*it).names();
106}
107
243
251
286
321
331{
332 const QStringList optionNames = option.names();
333
334 if (!optionNames.isEmpty()) {
335 for (const QString &name : optionNames) {
336 if (d->nameHash.contains(name)) {
337 qWarning() << "QCommandLineParser: already having an option named" << name;
338 return false;
339 }
340 }
341
343
345 for (const QString &name : optionNames)
347
348 return true;
349 }
350
351 return false;
352}
353
365bool QCommandLineParser::addOptions(const QList<QCommandLineOption> &options)
366{
367 // should be optimized (but it's no worse than what was possible before)
368 bool result = true;
369 for (QList<QCommandLineOption>::const_iterator it = options.begin(), end = options.end(); it != end; ++it)
370 result &= addOption(*it);
371 return result;
372}
373
384{
385 QCommandLineOption opt(QStringList() << QStringLiteral("v") << QStringLiteral("version"), tr("Displays version information."));
386 addOption(opt);
387 d->builtinVersionOption = true;
388 return opt;
389}
390
410{
412#ifdef Q_OS_WIN
413 << QStringLiteral("?")
414#endif
415 << QStringLiteral("h")
416 << QStringLiteral("help"), tr("Displays help on commandline options."));
417 addOption(opt);
418 QCommandLineOption optHelpAll(QStringLiteral("help-all"),
419 tr("Displays help, including generic Qt options."));
420 addOption(optHelpAll);
421 d->builtinHelpOption = true;
422 return opt;
423}
424
429{
430 d->description = description;
431}
432
440
453void QCommandLineParser::addPositionalArgument(const QString &name, const QString &description, const QString &syntax)
454{
456 arg.name = name;
457 arg.description = description;
458 arg.syntax = syntax.isEmpty() ? name : syntax;
460}
461
477
498{
499 return d->parse(arguments);
500}
501
507{
508 if (!d->errorText.isEmpty())
509 return d->errorText;
510 if (d->unknownOptionNames.size() == 1)
511 return tr("Unknown option '%1'.").arg(d->unknownOptionNames.constFirst());
512 if (d->unknownOptionNames.size() > 1)
513 return tr("Unknown options: %1.").arg(d->unknownOptionNames.join(QStringLiteral(", ")));
514 return QString();
515}
516
518
519#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
520// Return whether to use a message box. Use handles if a console can be obtained
521// or we are run with redirected handles (for example, by QProcess).
522static inline bool displayMessageBox()
523{
524 if (GetConsoleWindow()
525 || qEnvironmentVariableIsSet("QT_COMMAND_LINE_PARSER_NO_GUI_MESSAGE_BOXES"))
526 return false;
527 STARTUPINFO startupInfo;
528 startupInfo.cb = sizeof(STARTUPINFO);
529 GetStartupInfo(&startupInfo);
530 return !(startupInfo.dwFlags & STARTF_USESTDHANDLES);
531}
532#endif // Q_OS_WIN && !QT_BOOTSTRAPPED
533
535{
536#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
537 if (displayMessageBox()) {
538 const UINT flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND
539 | (type == UsageMessage ? MB_ICONINFORMATION : MB_ICONERROR);
542 title = QCoreApplication::instance()->property("applicationDisplayName").toString();
543 if (title.isEmpty())
545 MessageBoxW(0, reinterpret_cast<const wchar_t *>(message.utf16()),
546 reinterpret_cast<const wchar_t *>(title.utf16()), flags);
547 return;
548 }
549#endif // Q_OS_WIN && !QT_BOOTSTRAPPED
550 fputs(qPrintable(message), type == UsageMessage ? stdout : stderr);
551}
552
568{
569 if (!d->parse(arguments)) {
572 ::exit(EXIT_FAILURE);
573 }
574
575 if (d->builtinVersionOption && isSet(QStringLiteral("version")))
576 showVersion();
577
578 if (d->builtinHelpOption && isSet(QStringLiteral("help")))
579 d->showHelp(EXIT_SUCCESS, false);
580
581 if (d->builtinHelpOption && isSet(QStringLiteral("help-all")))
582 d->showHelp(EXIT_SUCCESS, true);
583}
584
591{
592 // QCoreApplication::arguments() is static, but the app instance must exist so we require it as parameter
593 Q_UNUSED(app);
595}
596
598{
599 if (needsParsing)
600 qWarning("QCommandLineParser: call process() or parse() before %s", method);
601}
602
609{
610 if (nameHash.contains(optionName)) {
611 optionNames.append(optionName);
612 return true;
613 } else {
614 unknownOptionNames.append(optionName);
615 return false;
616 }
617}
618
632 QStringList::const_iterator *argumentIterator, QStringList::const_iterator argsEnd)
633{
634 const QLatin1Char assignChar('=');
635 const NameHash_t::const_iterator nameHashIt = nameHash.constFind(optionName);
636 if (nameHashIt != nameHash.constEnd()) {
637 const qsizetype assignPos = argument.indexOf(assignChar);
638 const NameHash_t::mapped_type optionOffset = *nameHashIt;
639 const bool withValue = !commandLineOptionList.at(optionOffset).valueName().isEmpty();
640 if (withValue) {
641 if (assignPos == -1) {
642 ++(*argumentIterator);
643 if (*argumentIterator == argsEnd) {
644 errorText = QCommandLineParser::tr("Missing value after '%1'.").arg(argument);
645 return false;
646 }
647 optionValuesHash[optionOffset].append(*(*argumentIterator));
648 } else {
649 optionValuesHash[optionOffset].append(argument.mid(assignPos + 1));
650 }
651 } else {
652 if (assignPos != -1) {
653 errorText = QCommandLineParser::tr("Unexpected value after '%1'.").arg(argument.left(assignPos));
654 return false;
655 }
656 }
657 }
658 return true;
659}
660
673{
674 needsParsing = false;
675 bool error = false;
676
677 const QLatin1Char dashChar('-');
678 const QLatin1Char assignChar('=');
679
680 bool forcePositional = false;
683 optionNames.clear();
684 unknownOptionNames.clear();
686
687 if (args.isEmpty()) {
688 qWarning("QCommandLineParser: argument list cannot be empty, it should contain at least the executable name");
689 return false;
690 }
691
692 QStringList::const_iterator argumentIterator = args.begin();
693 ++argumentIterator; // skip executable name
694
695 for (; argumentIterator != args.end() ; ++argumentIterator) {
696 QString argument = *argumentIterator;
697
698 if (forcePositional) {
700 } else if (argument.startsWith("--"_L1)) {
701 if (argument.size() > 2) {
702 QString optionName = argument.mid(2).section(assignChar, 0, 0);
703 if (registerFoundOption(optionName)) {
704 if (!parseOptionValue(optionName, argument, &argumentIterator, args.end()))
705 error = true;
706 } else {
707 error = true;
708 }
709 } else {
710 forcePositional = true;
711 }
712 } else if (argument.startsWith(dashChar)) {
713 if (argument.size() == 1) { // single dash ("stdin")
715 continue;
716 }
717 switch (singleDashWordOptionMode) {
719 {
720 QString optionName;
721 bool valueFound = false;
722 for (int pos = 1 ; pos < argument.size(); ++pos) {
723 optionName = argument.mid(pos, 1);
724 if (!registerFoundOption(optionName)) {
725 error = true;
726 } else {
727 const NameHash_t::const_iterator nameHashIt = nameHash.constFind(optionName);
728 Q_ASSERT(nameHashIt != nameHash.constEnd()); // checked by registerFoundOption
729 const NameHash_t::mapped_type optionOffset = *nameHashIt;
730 const bool withValue = !commandLineOptionList.at(optionOffset).valueName().isEmpty();
731 if (withValue) {
732 if (pos + 1 < argument.size()) {
733 if (argument.at(pos + 1) == assignChar)
734 ++pos;
735 optionValuesHash[optionOffset].append(argument.mid(pos + 1));
736 valueFound = true;
737 }
738 break;
739 }
740 if (pos + 1 < argument.size() && argument.at(pos + 1) == assignChar)
741 break;
742 }
743 }
744 if (!valueFound && !parseOptionValue(optionName, argument, &argumentIterator, args.end()))
745 error = true;
746 break;
747 }
749 {
750 if (argument.size() > 2) {
751 const QString possibleShortOptionStyleName = argument.mid(1, 1);
752 const auto shortOptionIt = nameHash.constFind(possibleShortOptionStyleName);
753 if (shortOptionIt != nameHash.constEnd()) {
754 const auto &arg = commandLineOptionList.at(*shortOptionIt);
756 registerFoundOption(possibleShortOptionStyleName);
757 optionValuesHash[*shortOptionIt].append(argument.mid(2));
758 break;
759 }
760 }
761 }
762 const QString optionName = argument.mid(1).section(assignChar, 0, 0);
763 if (registerFoundOption(optionName)) {
764 if (!parseOptionValue(optionName, argument, &argumentIterator, args.end()))
765 error = true;
766 } else {
767 error = true;
768 }
769 break;
770 }
771 }
772 } else {
775 forcePositional = true;
776 }
777 if (argumentIterator == args.end())
778 break;
779 }
780 return !error;
781}
782
798{
799 d->checkParsed("isSet");
800 if (d->optionNames.contains(name))
801 return true;
802 const QStringList aliases = d->aliases(name);
803 for (const QString &optionName : std::as_const(d->optionNames)) {
804 if (aliases.contains(optionName))
805 return true;
806 }
807 return false;
808}
809
829{
830 d->checkParsed("value");
831 const QStringList valueList = values(optionName);
832
833 if (!valueList.isEmpty())
834 return valueList.last();
835
836 return QString();
837}
838
858{
859 d->checkParsed("values");
860 auto it = d->nameHash.constFind(optionName);
861 if (it != d->nameHash.cend()) {
862 const qsizetype optionOffset = *it;
863 QStringList values = d->optionValuesHash.value(optionOffset);
864 if (values.isEmpty()) {
865 const auto &option = d->commandLineOptionList.at(optionOffset);
866 if (option.valueName().isEmpty()) {
867 qWarning("QCommandLineParser: option not expecting values: \"%ls\"",
868 qUtf16Printable(optionName));
869 }
870 values = option.defaultValues();
871 }
872 return values;
873 }
874
875 qWarning("QCommandLineParser: option not defined: \"%ls\"", qUtf16Printable(optionName));
876 return QStringList();
877}
878
891{
892 // option.names() might be empty if the constructor failed
893 const auto names = option.names();
894 return !names.isEmpty() && isSet(names.first());
895}
896
911{
912 return value(option.names().constFirst());
913}
914
929{
930 return values(option.names().constFirst());
931}
932
941{
942 d->checkParsed("positionalArguments");
943 return d->positionalArgumentList;
944}
945
963{
964 d->checkParsed("optionNames");
965 return d->optionNames;
966}
967
983{
984 d->checkParsed("unknownOptionNames");
985 return d->unknownOptionNames;
986}
987
1006
1019{
1020 d->showHelp(exitCode, false);
1021}
1022
1023Q_NORETURN void QCommandLineParserPrivate::showHelp(int exitCode, bool includeQtOptions)
1024{
1025 showParserMessage(helpText(includeQtOptions), UsageMessage);
1027 ::exit(exitCode);
1028}
1029
1036{
1037 return d->helpText(false);
1038}
1039
1040static QString wrapText(const QString &names, int optionNameMaxWidth, const QString &description)
1041{
1042 const auto nl = u'\n';
1043 const auto indentation = " "_L1;
1044
1045 // In case the list of option names is very long, wrap it as well
1046 int nameIndex = 0;
1047 auto nextNameSection = [&]() {
1048 QString section = names.mid(nameIndex, optionNameMaxWidth);
1049 nameIndex += section.size();
1050 return section;
1051 };
1052
1053 QString text;
1054 qsizetype lineStart = 0;
1055 qsizetype lastBreakable = -1;
1056 const int max = 79 - (indentation.size() + optionNameMaxWidth + 1);
1057 int x = 0;
1058 const qsizetype len = description.size();
1059
1060 for (qsizetype i = 0; i < len; ++i) {
1061 ++x;
1062 const QChar c = description.at(i);
1063 if (c.isSpace())
1064 lastBreakable = i;
1065
1066 qsizetype breakAt = -1;
1067 qsizetype nextLineStart = -1;
1068 if (x > max && lastBreakable != -1) {
1069 // time to break and we know where
1070 breakAt = lastBreakable;
1071 nextLineStart = lastBreakable + 1;
1072 } else if ((x > max - 1 && lastBreakable == -1) || i == len - 1) {
1073 // time to break but found nowhere [-> break here], or end of last line
1074 breakAt = i + 1;
1075 nextLineStart = breakAt;
1076 } else if (c == nl) {
1077 // forced break
1078 breakAt = i;
1079 nextLineStart = i + 1;
1080 }
1081
1082 if (breakAt != -1) {
1083 const qsizetype numChars = breakAt - lineStart;
1084 //qDebug() << "breakAt=" << description.at(breakAt) << "breakAtSpace=" << breakAtSpace << lineStart << "to" << breakAt << description.mid(lineStart, numChars);
1085 text += indentation + nextNameSection().leftJustified(optionNameMaxWidth) + u' ';
1086 text += QStringView{description}.mid(lineStart, numChars) + nl;
1087 x = 0;
1088 lastBreakable = -1;
1089 lineStart = nextLineStart;
1090 if (lineStart < len && description.at(lineStart).isSpace())
1091 ++lineStart; // don't start a line with a space
1092 i = lineStart;
1093 }
1094 }
1095
1096 while (nameIndex < names.size()) {
1097 text += indentation + nextNameSection() + nl;
1098 }
1099
1100 return text;
1101}
1102
1104{
1105 const QLatin1Char nl('\n');
1106 QString text;
1107 QString usage;
1108 // executable name
1110 : QStringView(u"<executable_name>");
1111 QList<QCommandLineOption> options = commandLineOptionList;
1112 if (includeQtOptions && qApp)
1113 qApp->d_func()->addQtOptions(&options);
1114 if (!options.isEmpty())
1115 usage += u' ' + QCommandLineParser::tr("[options]");
1117 usage += u' ' + arg.syntax;
1118 text += QCommandLineParser::tr("Usage: %1").arg(usage) + nl;
1119 if (!description.isEmpty())
1120 text += description + nl;
1121 text += nl;
1122 if (!options.isEmpty())
1123 text += QCommandLineParser::tr("Options:") + nl;
1124 QStringList optionNameList;
1125 optionNameList.reserve(options.size());
1126 qsizetype longestOptionNameString = 0;
1127 for (const QCommandLineOption &option : std::as_const(options)) {
1129 continue;
1130 const QStringList optionNames = option.names();
1131 QString optionNamesString;
1132 for (const QString &optionName : optionNames) {
1133 const int numDashes = optionName.size() == 1 ? 1 : 2;
1134 optionNamesString += QLatin1StringView("--", numDashes) + optionName + ", "_L1;
1135 }
1136 if (!optionNames.isEmpty())
1137 optionNamesString.chop(2); // remove trailing ", "
1138 const auto valueName = option.valueName();
1139 if (!valueName.isEmpty())
1140 optionNamesString += " <"_L1 + valueName + u'>';
1141 optionNameList.append(optionNamesString);
1142 longestOptionNameString = qMax(longestOptionNameString, optionNamesString.size());
1143 }
1144 ++longestOptionNameString;
1145 const int optionNameMaxWidth = qMin(50, int(longestOptionNameString));
1146 auto optionNameIterator = optionNameList.cbegin();
1147 for (const QCommandLineOption &option : std::as_const(options)) {
1149 continue;
1150 text += wrapText(*optionNameIterator, optionNameMaxWidth, option.description());
1151 ++optionNameIterator;
1152 }
1153 if (!positionalArgumentDefinitions.isEmpty()) {
1154 if (!options.isEmpty())
1155 text += nl;
1156 text += QCommandLineParser::tr("Arguments:") + nl;
1158 text += wrapText(arg.name, optionNameMaxWidth, arg.description);
1159 }
1160 return text;
1161}
1162
\inmodule QtCore
The QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
QString valueName() const
Returns the name of the expected value.
QStringList names() const
Returns the names set for this option.
QStringList aliases(const QString &name) const
bool parseOptionValue(const QString &optionName, const QString &argument, QStringList::const_iterator *argumentIterator, QStringList::const_iterator argsEnd)
Parse the value for a given option, if it was defined to expect one.
bool registerFoundOption(const QString &optionName)
NameHash_t nameHash
Hash mapping option names to their offsets in commandLineOptionList and optionArgumentList.
bool builtinVersionOption
Whether addVersionOption was called.
QHash< qsizetype, QStringList > optionValuesHash
Option values found (only for options with a value)
QStringList optionNames
Names of options found on the command line.
QString helpText(bool includeQtOptions) const
QString description
Application description.
bool needsParsing
True if parse() needs to be called.
void checkParsed(const char *method)
QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode
The parsing mode for "-abc".
bool parse(const QStringList &args)
bool builtinHelpOption
Whether addHelpOption was called.
QStringList unknownOptionNames
Names of options which were unknown.
QCommandLineParser::OptionsAfterPositionalArgumentsMode optionsAfterPositionalArgumentsMode
How to parse "arg -option".
QStringList positionalArgumentList
Arguments which did not belong to any option.
QList< PositionalArgumentDefinition > positionalArgumentDefinitions
Q_NORETURN void showHelp(int exitCode, bool includeQtOptions)
QList< QCommandLineOption > commandLineOptionList
The command line options used for parsing.
QString errorText
Error text set when parse() returns false.
The QCommandLineParser class provides a means for handling the command line options.
QString value(const QString &name) const
Returns the option value found for the given option name optionName, or an empty string if not found.
bool parse(const QStringList &arguments)
Parses the command line arguments.
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax=QString())
Defines an additional argument to the application, for the benefit of the help text.
QString applicationDescription() const
Returns the application description set in setApplicationDescription().
QStringList positionalArguments() const
Returns a list of positional arguments.
QStringList unknownOptionNames() const
Returns a list of unknown option names.
void setSingleDashWordOptionMode(SingleDashWordOptionMode parsingMode)
Sets the parsing mode to singleDashWordOptionMode.
Q_NORETURN void showVersion()
Displays the version information from QCoreApplication::applicationVersion(), and exits the applicati...
QStringList values(const QString &name) const
Returns a list of option values found for the given option name optionName, or an empty list if not f...
void setApplicationDescription(const QString &description)
Sets the application description shown by helpText().
bool addOptions(const QList< QCommandLineOption > &options)
bool addOption(const QCommandLineOption &commandLineOption)
Adds the option option to look for while parsing.
Q_NORETURN void showHelp(int exitCode=0)
Displays the help information, and exits the application.
QString errorText() const
Returns a translated error text for the user.
SingleDashWordOptionMode
This enum describes the way the parser interprets command-line options that use a single dash followe...
bool isSet(const QString &name) const
Checks whether the option name was passed to the application.
~QCommandLineParser()
Destroys the command line parser object.
QCommandLineParser()
Constructs a command line parser object.
QString helpText() const
Returns a string containing the complete help information.
QStringList optionNames() const
Returns a list of option names that were found.
void process(const QStringList &arguments)
Processes the command line arguments.
void clearPositionalArguments()
Clears the definitions of additional arguments from the help text.
OptionsAfterPositionalArgumentsMode
This enum describes the way the parser interprets options that occur after positional arguments.
void setOptionsAfterPositionalArgumentsMode(OptionsAfterPositionalArgumentsMode mode)
Sets the parsing mode to parsingMode.
QCommandLineOption addVersionOption()
Adds the {-v} / {–version} option, which displays the version string of the application.
QCommandLineOption addHelpOption()
Adds help options to the command-line parser.
\inmodule QtCore
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
QString applicationVersion
the version of this application
static QStringList arguments()
QString applicationName
the name of this application
const_iterator constFind(const Key &key) const noexcept
Definition qhash.h:1299
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
Definition qhash.h:1219
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
Definition qhash.h:1007
T value(const Key &key) const noexcept
Definition qhash.h:1054
friend class const_iterator
Definition qhash.h:1182
const_iterator cend() const noexcept
Definition qhash.h:1218
qsizetype mapped_type
Typedef for T.
Definition qhash.h:831
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
Definition qhash.h:951
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition qhash.h:1303
constexpr void chop(qsizetype n)
qsizetype size() const noexcept
Definition qlist.h:397
bool isEmpty() const noexcept
Definition qlist.h:401
iterator end()
Definition qlist.h:626
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
iterator begin()
Definition qlist.h:625
void append(parameter_type t)
Definition qlist.h:458
\inmodule QtCore
\inmodule QtCore
Definition qstringview.h:78
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
Definition qstring.cpp:6995
QString mid(qsizetype position, qsizetype n=-1) const &
Definition qstring.cpp:5300
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
void clear()
Clears the contents of the string and makes it null.
Definition qstring.h:1252
qsizetype size() const noexcept
Returns the number of characters in this string.
Definition qstring.h:186
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8870
QString leftJustified(qsizetype width, QChar fill=u' ', bool trunc=false) const
Returns a string of size width that contains this string padded by the fill character.
Definition qstring.cpp:7022
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
Definition qstring.h:1226
QString text
QSet< QString >::iterator it
QList< QVariant > arguments
QStyleOptionButton opt
Combined button and popup list for selecting options.
QHash< QString, qsizetype > NameHash_t
static QString wrapText(const QString &names, int optionNameMaxWidth, const QString &description)
static void showParserMessage(const QString &message, MessageType type)
void Q_CORE_EXPORT qt_call_post_routines()
#define Q_NORETURN
QList< QString > QStringList
Constructs a string list that contains the given string, str.
void Q_CORE_EXPORT qt_call_post_routines()
#define qApp
DBusConnection const char DBusError * error
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
static void showHelp()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qWarning
Definition qlogging.h:166
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLenum GLsizei GLsizei GLint * values
[15]
GLint GLint GLint GLint GLint x
[0]
GLuint GLuint end
GLenum type
GLbitfield flags
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
GLuint name
const GLubyte * c
GLuint GLuint * names
GLuint64EXT * result
[6]
GLuint GLenum option
GLenum GLsizei len
GLsizeiptr const void GLenum usage
Definition qopenglext.h:543
static QStringList aliases(const QQmlJSScope::ConstPtr &scope)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int void * arg
#define qPrintable(string)
Definition qstring.h:1531
#define qUtf16Printable(string)
Definition qstring.h:1543
#define QStringLiteral(str)
#define tr(X)
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
#define Q_UNUSED(x)
@ Q_RELOCATABLE_TYPE
Definition qtypeinfo.h:158
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
Definition qtypeinfo.h:180
ptrdiff_t qsizetype
Definition qtypes.h:165
QString title
[35]
QApplication app(argc, argv)
[0]
QDBusArgument argument
QJSValueList args
\inmodule QtCore \reentrant
Definition qchar.h:18