40 QCommandLineOption::Flags
flags;
218 typedef bool result_type;
222 result_type operator()(
const QString &
name)
const noexcept
225 return warn(
"be empty");
229 return warn(
"start with a '-'");
231 return warn(
"start with a '/'");
233 return warn(
"contain a '='");
239 static bool warn(
const char *what)
noexcept
241 qWarning(
"QCommandLineOption: Option names cannot %s", what);
251 qWarning(
"QCommandLineOption: Options must have at least one name");
253 nameList.removeIf(IsInvalidName());
328 newDefaultValues.reserve(1);
329 newDefaultValues << defaultValue;
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 QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
void setDescription(const QString &description)
Sets the description used for this option to description.
Flags flags() const
Returns a set of flags that affect this command-line option.
void setDefaultValue(const QString &defaultValue)
Sets the default value used for this option to defaultValue.
~QCommandLineOption()
Destroys the command line option object.
QString valueName() const
Returns the name of the expected value.
QString description() const
Returns the description set for this option.
void setFlags(Flags aflags)
Set the set of flags that affect this command-line option to flags.
void setDefaultValues(const QStringList &defaultValues)
Sets the list of default values used for this option to defaultValues.
void setValueName(const QString &name)
Sets the name of the expected value, for the documentation, to valueName.
QStringList defaultValues() const
Returns the default values set for this option.
QCommandLineOption & operator=(const QCommandLineOption &other)
Move-assigns other to this QCommandLineOption instance.
QStringList names() const
Returns the names set for this option.
QCommandLineOption(const QString &name)
Constructs a command line option object with the name name.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Combined button and popup list for selecting options.