API reference - Class QCommandLineOption

Notation used in Ruby API documentation

Module: QtCore

Description: Binding of QCommandLineOption

Sub-classes: Flag, QFlags_Flag

Public constructors

new QCommandLineOptionnew(string name)Constructor QCommandLineOption::QCommandLineOption(const QString &name)
new QCommandLineOptionnew(string[] names)Constructor QCommandLineOption::QCommandLineOption(const QStringList &names)
new QCommandLineOptionnew(string name,
string description,
string valueName = QString(),
string defaultValue = QString())
Constructor QCommandLineOption::QCommandLineOption(const QString &name, const QString &description, const QString &valueName, const QString &defaultValue)
new QCommandLineOptionnew(string[] names,
string description,
string valueName = QString(),
string defaultValue = QString())
Constructor QCommandLineOption::QCommandLineOption(const QStringList &names, const QString &description, const QString &valueName, const QString &defaultValue)
new QCommandLineOptionnew(const QCommandLineOption other)Constructor QCommandLineOption::QCommandLineOption(const QCommandLineOption &other)

Public methods

void_assign(const QCommandLineOption other)Assigns another object to self
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
QCommandLineOptionassign(const QCommandLineOption other)Method QCommandLineOption &QCommandLineOption::operator=(const QCommandLineOption &other)
[const]string[]defaultValuesMethod QStringList QCommandLineOption::defaultValues()
voiddefaultValues=(string[] defaultValues)Method void QCommandLineOption::setDefaultValues(const QStringList &defaultValues)
[const]stringdescriptionMethod QString QCommandLineOption::description()
voiddescription=(string description)Method void QCommandLineOption::setDescription(const QString &description)
[const]new QCommandLineOption ptrdupCreates a copy of self
[const]QCommandLineOption_QFlags_FlagflagsMethod QFlags<QCommandLineOption::Flag> QCommandLineOption::flags()
voidflags=(QCommandLineOption_QFlags_Flag aflags)Method void QCommandLineOption::setFlags(QFlags<QCommandLineOption::Flag> aflags)
[const]boolhiddenMethod bool QCommandLineOption::isHidden()
voidhidden=(bool hidden)Method void QCommandLineOption::setHidden(bool hidden)
[const]boolisHidden?Method bool QCommandLineOption::isHidden()
[const]string[]namesMethod QStringList QCommandLineOption::names()
voidsetDefaultValue(string defaultValue)Method void QCommandLineOption::setDefaultValue(const QString &defaultValue)
voidsetDefaultValues(string[] defaultValues)Method void QCommandLineOption::setDefaultValues(const QStringList &defaultValues)
voidsetDescription(string description)Method void QCommandLineOption::setDescription(const QString &description)
voidsetFlags(QCommandLineOption_QFlags_Flag aflags)Method void QCommandLineOption::setFlags(QFlags<QCommandLineOption::Flag> aflags)
voidsetHidden(bool hidden)Method void QCommandLineOption::setHidden(bool hidden)
voidsetValueName(string name)Method void QCommandLineOption::setValueName(const QString &name)
voidswap(QCommandLineOption other)Method void QCommandLineOption::swap(QCommandLineOption &other)
[const]stringvalueNameMethod QString QCommandLineOption::valueName()
voidvalueName=(string name)Method void QCommandLineOption::setValueName(const QString &name)

Public static methods and constants

[static,const]QCommandLineOption_FlagHiddenFromHelpEnum constant QCommandLineOption::HiddenFromHelp
[static,const]QCommandLineOption_FlagShortOptionStyleEnum constant QCommandLineOption::ShortOptionStyle

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

HiddenFromHelp

Signature: [static,const] QCommandLineOption_Flag HiddenFromHelp

Description: Enum constant QCommandLineOption::HiddenFromHelp

Python specific notes:
The object exposes a readable attribute 'HiddenFromHelp'. This is the getter.

ShortOptionStyle

Signature: [static,const] QCommandLineOption_Flag ShortOptionStyle

Description: Enum constant QCommandLineOption::ShortOptionStyle

Python specific notes:
The object exposes a readable attribute 'ShortOptionStyle'. This is the getter.

_assign

Signature: void _assign (const QCommandLineOption other)

Description: Assigns another object to self

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

assign

Signature: QCommandLineOption assign (const QCommandLineOption other)

Description: Method QCommandLineOption &QCommandLineOption::operator=(const QCommandLineOption &other)

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

defaultValues

Signature: [const] string[] defaultValues

Description: Method QStringList QCommandLineOption::defaultValues()

Python specific notes:
The object exposes a readable attribute 'defaultValues'. This is the getter.

defaultValues=

Signature: void defaultValues= (string[] defaultValues)

Description: Method void QCommandLineOption::setDefaultValues(const QStringList &defaultValues)

Python specific notes:
The object exposes a writable attribute 'defaultValues'. This is the setter.

description

Signature: [const] string description

Description: Method QString QCommandLineOption::description()

Python specific notes:
The object exposes a readable attribute 'description'. This is the getter.

description=

Signature: void description= (string description)

Description: Method void QCommandLineOption::setDescription(const QString &description)

Python specific notes:
The object exposes a writable attribute 'description'. This is the setter.

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

dup

Signature: [const] new QCommandLineOption ptr dup

Description: Creates a copy of self

Python specific notes:
This method also implements '__copy__' and '__deepcopy__'.

flags

Signature: [const] QCommandLineOption_QFlags_Flag flags

Description: Method QFlags<QCommandLineOption::Flag> QCommandLineOption::flags()

Python specific notes:
The object exposes a readable attribute 'flags'. This is the getter.

flags=

Signature: void flags= (QCommandLineOption_QFlags_Flag aflags)

Description: Method void QCommandLineOption::setFlags(QFlags<QCommandLineOption::Flag> aflags)

Python specific notes:
The object exposes a writable attribute 'flags'. This is the setter.

hidden

Signature: [const] bool hidden

Description: Method bool QCommandLineOption::isHidden()

Python specific notes:
The object exposes a readable attribute 'hidden'. This is the getter.

hidden=

Signature: void hidden= (bool hidden)

Description: Method void QCommandLineOption::setHidden(bool hidden)

Python specific notes:
The object exposes a writable attribute 'hidden'. This is the setter.

isHidden?

Signature: [const] bool isHidden?

Description: Method bool QCommandLineOption::isHidden()

Python specific notes:
The object exposes a readable attribute 'hidden'. This is the getter.

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

names

Signature: [const] string[] names

Description: Method QStringList QCommandLineOption::names()

new

(1) Signature: [static] new QCommandLineOption new (string name)

Description: Constructor QCommandLineOption::QCommandLineOption(const QString &name)

This method creates an object of class QCommandLineOption.

Python specific notes:
This method is the default initializer of the object.

(2) Signature: [static] new QCommandLineOption new (string[] names)

Description: Constructor QCommandLineOption::QCommandLineOption(const QStringList &names)

This method creates an object of class QCommandLineOption.

Python specific notes:
This method is the default initializer of the object.

(3) Signature: [static] new QCommandLineOption new (string name, string description, string valueName = QString(), string defaultValue = QString())

Description: Constructor QCommandLineOption::QCommandLineOption(const QString &name, const QString &description, const QString &valueName, const QString &defaultValue)

This method creates an object of class QCommandLineOption.

Python specific notes:
This method is the default initializer of the object.

(4) Signature: [static] new QCommandLineOption new (string[] names, string description, string valueName = QString(), string defaultValue = QString())

Description: Constructor QCommandLineOption::QCommandLineOption(const QStringList &names, const QString &description, const QString &valueName, const QString &defaultValue)

This method creates an object of class QCommandLineOption.

Python specific notes:
This method is the default initializer of the object.

(5) Signature: [static] new QCommandLineOption new (const QCommandLineOption other)

Description: Constructor QCommandLineOption::QCommandLineOption(const QCommandLineOption &other)

This method creates an object of class QCommandLineOption.

Python specific notes:
This method is the default initializer of the object.

setDefaultValue

Signature: void setDefaultValue (string defaultValue)

Description: Method void QCommandLineOption::setDefaultValue(const QString &defaultValue)

setDefaultValues

Signature: void setDefaultValues (string[] defaultValues)

Description: Method void QCommandLineOption::setDefaultValues(const QStringList &defaultValues)

Python specific notes:
The object exposes a writable attribute 'defaultValues'. This is the setter.

setDescription

Signature: void setDescription (string description)

Description: Method void QCommandLineOption::setDescription(const QString &description)

Python specific notes:
The object exposes a writable attribute 'description'. This is the setter.

setFlags

Signature: void setFlags (QCommandLineOption_QFlags_Flag aflags)

Description: Method void QCommandLineOption::setFlags(QFlags<QCommandLineOption::Flag> aflags)

Python specific notes:
The object exposes a writable attribute 'flags'. This is the setter.

setHidden

Signature: void setHidden (bool hidden)

Description: Method void QCommandLineOption::setHidden(bool hidden)

Python specific notes:
The object exposes a writable attribute 'hidden'. This is the setter.

setValueName

Signature: void setValueName (string name)

Description: Method void QCommandLineOption::setValueName(const QString &name)

Python specific notes:
The object exposes a writable attribute 'valueName'. This is the setter.

swap

Signature: void swap (QCommandLineOption other)

Description: Method void QCommandLineOption::swap(QCommandLineOption &other)

valueName

Signature: [const] string valueName

Description: Method QString QCommandLineOption::valueName()

Python specific notes:
The object exposes a readable attribute 'valueName'. This is the getter.

valueName=

Signature: void valueName= (string name)

Description: Method void QCommandLineOption::setValueName(const QString &name)

Python specific notes:
The object exposes a writable attribute 'valueName'. This is the setter.