pub struct QCommandLineOption { /* private fields */ }Expand description
The QCommandLineOption class defines a possible command-line option.
Qt Documentation: QCommandLineOption
Implementations§
Source§impl QCommandLineOption
impl QCommandLineOption
Sourcepub fn default_values(&self) -> QStringList
pub fn default_values(&self) -> QStringList
Returns the default values set for this option.
Sourcepub fn description(&self) -> QString
pub fn description(&self) -> QString
Returns the description set for this option.
Sourcepub fn names(&self) -> QStringList
pub fn names(&self) -> QStringList
Returns the names set for this option.
Sourcepub fn set_default_value(&mut self, default_value: &QString)
pub fn set_default_value(&mut self, default_value: &QString)
Sets the default value used for this option to default_value.
The default value is used if the user of the application does not specify the option on the command line.
If default_value is empty, the option has no default values.
Sourcepub fn set_default_values(&mut self, default_values: &QStringList)
pub fn set_default_values(&mut self, default_values: &QStringList)
Sets the list of default values used for this option to default_values.
The default values are used if the user of the application does not specify the option on the command line.
Sourcepub fn set_description(&mut self, description: &QString)
pub fn set_description(&mut self, description: &QString)
Sets the description used for this option to description.
It is customary to add a “.” at the end of the description.
The description is used by QCommandLineParser::showHelp().
Sourcepub fn set_value_name(&mut self, value_name: &QString)
pub fn set_value_name(&mut self, value_name: &QString)
Sets the name of the expected value, for the documentation, to value_name.
Options without a value assigned have a boolean-like behavior: either the user specifies –option or they don’t.
Options with a value assigned need to set a name for the expected value, for the documentation of the option in the help output. An option with names o and output, and a value name of file will appear as -o, --output <file>.
Call QCommandLineParser::value if you expect the option to be present only once, and QCommandLineParser::values if you expect that option to be present multiple times.
Sourcepub fn value_name(&self) -> QString
pub fn value_name(&self) -> QString
Returns the name of the expected value.
Trait Implementations§
Source§impl Clone for QCommandLineOption
impl Clone for QCommandLineOption
Source§impl ExternType for QCommandLineOption
impl ExternType for QCommandLineOption
Source§impl From<&QString> for QCommandLineOption
impl From<&QString> for QCommandLineOption
Source§impl From<&QStringList> for QCommandLineOption
impl From<&QStringList> for QCommandLineOption
Source§fn from(names: &QStringList) -> Self
fn from(names: &QStringList) -> Self
Constructs a command line option object with the name name.