40 QCommandLineOption::Flags
flags;
216 typedef bool result_type;
220 result_type operator()(
const QString &
name)
const noexcept
223 return warn(
"be empty");
227 return warn(
"start with a '-'");
229 return warn(
"start with a '/'");
231 return warn(
"contain a '='");
237 static bool warn(
const char *what)
noexcept
239 qWarning(
"QCommandLineOption: Option names cannot %s", what);
249 qWarning(
"QCommandLineOption: Options must have at least one name");
251 nameList.removeIf(IsInvalidName());
326 newDefaultValues.reserve(1);
327 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 noexcept
Returns true if the string has no characters; otherwise returns false.
Combined button and popup list for selecting options.