Skip to main content

QCommandLineOption

Struct QCommandLineOption 

Source
pub struct QCommandLineOption { /* private fields */ }
Expand description

The QCommandLineOption class defines a possible command-line option.

Qt Documentation: QCommandLineOption

Implementations§

Source§

impl QCommandLineOption

Source

pub fn default_values(&self) -> QStringList

Returns the default values set for this option.

Source

pub fn description(&self) -> QString

Returns the description set for this option.

Source

pub fn names(&self) -> QStringList

Returns the names set for this option.

Source

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.

Source

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.

Source

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().

Source

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.

Source

pub fn value_name(&self) -> QString

Returns the name of the expected value.

Trait Implementations§

Source§

impl Clone for QCommandLineOption

Source§

fn clone(&self) -> Self

Constructs a copy of this QCommandLineOption.

1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Drop for QCommandLineOption

Source§

fn drop(&mut self)

Destroys the QCommandLineOption.

Source§

impl ExternType for QCommandLineOption

Source§

type Id = (Q, C, o, m, m, a, n, d, L, i, n, e, O, p, t, i, o, n)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Trivial

Source§

impl From<&QString> for QCommandLineOption

Source§

fn from(name: &QString) -> Self

Constructs a command line option object with the name name.

Source§

impl From<&QStringList> for QCommandLineOption

Source§

fn from(names: &QStringList) -> Self

Constructs a command line option object with the name name.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.