254 typedef bool result_type;
261 return warn(
"be empty");
265 return warn(
"start with a '-'");
267 return warn(
"start with a '/'");
269 return warn(
"contain a '='");
275 static bool warn(
const char *what) noexcept
277 qWarning(
"QCommandLineOption: Option names cannot %s", what);
287 qWarning(
"QCommandLineOption: Options must have at least one name");
289 nameList.removeIf(IsInvalidName());
364 newDefaultValues.reserve(1);
365 newDefaultValues << defaultValue;
The QChar class provides a 16-bit Unicode character.
The QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
void setDescription(const QString &description)
void setDefaultValue(const QString &defaultValue)
QString valueName() const
QString description() const
void setFlags(Flags aflags)
void setDefaultValues(const QStringList &defaultValues)
void setValueName(const QString &name)
QStringList defaultValues() const
QCommandLineOption & operator=(const QCommandLineOption &other)
QStringList names() const
QCommandLineOption(const QString &name)
QCommandLineOption::Flags flags
static QStringList removeInvalidNames(QStringList nameList)
Q_NEVER_INLINE QCommandLineOptionPrivate(const QString &name)
Q_NEVER_INLINE QCommandLineOptionPrivate(const QStringList &names)
QStringList names
The list of names used for this option.
QStringList defaultValues
The list of default values used for this option.
QString description
The description used for this option.
The QSharedData class is a base class for shared data objects. \reentrant.
The QString class provides a Unicode character string.
The QStringList class provides a list of strings.
constexpr T & operator()(T &v) const
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.