Struct qt_core::QMetaProperty

source ·
#[repr(C)]
pub struct QMetaProperty { /* private fields */ }
Expand description

The QMetaProperty class provides meta-data about a property.

C++ class: QMetaProperty.

C++ documentation:

The QMetaProperty class provides meta-data about a property.

Property meta-data is obtained from an object's meta-object. See QMetaObject::property() and QMetaObject::propertyCount() for details.

Implementations§

source§

impl QMetaProperty

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QMetaProperty>> ) -> Ref<QMetaProperty>

The QMetaProperty class provides meta-data about a property.

Calls C++ function: QMetaProperty& QMetaProperty::operator=(const QMetaProperty& other).

C++ documentation:

The QMetaProperty class provides meta-data about a property.

Property meta-data is obtained from an object's meta-object. See QMetaObject::property() and QMetaObject::propertyCount() for details.

source

pub unsafe fn enclosing_meta_object(&self) -> Ptr<QMetaObject>

Calls C++ function: const QMetaObject* QMetaProperty::enclosingMetaObject() const.

source

pub unsafe fn enumerator(&self) -> CppBox<QMetaEnum>

Returns the enumerator if this property's type is an enumerator type; otherwise the returned value is undefined.

Calls C++ function: QMetaEnum QMetaProperty::enumerator() const.

C++ documentation:

Returns the enumerator if this property’s type is an enumerator type; otherwise the returned value is undefined.

See also isEnumType() and isFlagType().

source

pub unsafe fn has_notify_signal(&self) -> bool

Returns true if this property has a corresponding change notify signal; otherwise returns false.

Calls C++ function: bool QMetaProperty::hasNotifySignal() const.

C++ documentation:

Returns true if this property has a corresponding change notify signal; otherwise returns false.

See also notifySignal().

source

pub unsafe fn has_std_cpp_set(&self) -> bool

Calls C++ function: bool QMetaProperty::hasStdCppSet() const.

source

pub unsafe fn is_constant(&self) -> bool

Returns true if the property is constant; otherwise returns false.

Calls C++ function: bool QMetaProperty::isConstant() const.

C++ documentation:

Returns true if the property is constant; otherwise returns false.

A property is constant if the Q_PROPERTY()'s CONSTANT attribute is set.

This function was introduced in Qt 4.6.

source

pub unsafe fn is_designable_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool

Returns true if this property is designable for the given object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isDesignable(const QObject* obj = …) const.

C++ documentation:

Returns true if this property is designable for the given object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s DESIGNABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isScriptable() and isStored().

source

pub unsafe fn is_designable_0a(&self) -> bool

Returns true if this property is designable for the given object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isDesignable() const.

C++ documentation:

Returns true if this property is designable for the given object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s DESIGNABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isScriptable() and isStored().

source

pub unsafe fn is_editable_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool

Returns true if the property is editable for the given object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isEditable(const QObject* obj = …) const.

C++ documentation:

Returns true if the property is editable for the given object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s EDITABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isDesignable(), isScriptable(), and isStored().

source

pub unsafe fn is_editable_0a(&self) -> bool

Returns true if the property is editable for the given object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isEditable() const.

C++ documentation:

Returns true if the property is editable for the given object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s EDITABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isDesignable(), isScriptable(), and isStored().

source

pub unsafe fn is_enum_type(&self) -> bool

Returns true if the property's type is an enumeration value; otherwise returns false.

Calls C++ function: bool QMetaProperty::isEnumType() const.

C++ documentation:

Returns true if the property’s type is an enumeration value; otherwise returns false.

See also enumerator() and isFlagType().

source

pub unsafe fn is_final(&self) -> bool

Returns true if the property is final; otherwise returns false.

Calls C++ function: bool QMetaProperty::isFinal() const.

C++ documentation:

Returns true if the property is final; otherwise returns false.

A property is final if the Q_PROPERTY()'s FINAL attribute is set.

This function was introduced in Qt 4.6.

source

pub unsafe fn is_flag_type(&self) -> bool

Returns true if the property's type is an enumeration value that is used as a flag; otherwise returns false.

Calls C++ function: bool QMetaProperty::isFlagType() const.

C++ documentation:

Returns true if the property’s type is an enumeration value that is used as a flag; otherwise returns false.

Flags can be combined using the OR operator. A flag type is implicitly also an enum type.

See also isEnumType(), enumerator(), and QMetaEnum::isFlag().

source

pub unsafe fn is_readable(&self) -> bool

Returns true if this property is readable; otherwise returns false.

Calls C++ function: bool QMetaProperty::isReadable() const.

C++ documentation:

Returns true if this property is readable; otherwise returns false.

See also isWritable(), read(), and isValid().

source

pub unsafe fn is_resettable(&self) -> bool

Returns true if this property can be reset to a default value; otherwise returns false.

Calls C++ function: bool QMetaProperty::isResettable() const.

C++ documentation:

Returns true if this property can be reset to a default value; otherwise returns false.

See also reset().

source

pub unsafe fn is_scriptable_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool

Returns true if the property is scriptable for the given object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isScriptable(const QObject* obj = …) const.

C++ documentation:

Returns true if the property is scriptable for the given object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s SCRIPTABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isDesignable() and isStored().

source

pub unsafe fn is_scriptable_0a(&self) -> bool

Returns true if the property is scriptable for the given object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isScriptable() const.

C++ documentation:

Returns true if the property is scriptable for the given object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s SCRIPTABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isDesignable() and isStored().

source

pub unsafe fn is_stored_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool

Returns true if the property is stored for object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isStored(const QObject* obj = …) const.

C++ documentation:

Returns true if the property is stored for object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s STORED attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isDesignable() and isScriptable().

source

pub unsafe fn is_stored_0a(&self) -> bool

Returns true if the property is stored for object; otherwise returns false.

Calls C++ function: bool QMetaProperty::isStored() const.

C++ documentation:

Returns true if the property is stored for object; otherwise returns false.

If no object is given, the function returns false if the Q_PROPERTY()'s STORED attribute is false; otherwise returns true (if the attribute is true or is a function or expression).

See also isDesignable() and isScriptable().

source

pub unsafe fn is_user_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool

Returns true if this property is designated as the USER property, i.e., the one that the user can edit for object or that is significant in some other way. Otherwise it returns false. e.g., the text property is the USER editable property of a QLineEdit.

Calls C++ function: bool QMetaProperty::isUser(const QObject* obj = …) const.

C++ documentation:

Returns true if this property is designated as the USER property, i.e., the one that the user can edit for object or that is significant in some other way. Otherwise it returns false. e.g., the text property is the USER editable property of a QLineEdit.

If object is null, the function returns false if the Q_PROPERTY()'s USER attribute is false. Otherwise it returns true.

See also QMetaObject::userProperty(), isDesignable(), and isScriptable().

source

pub unsafe fn is_user_0a(&self) -> bool

Returns true if this property is designated as the USER property, i.e., the one that the user can edit for object or that is significant in some other way. Otherwise it returns false. e.g., the text property is the USER editable property of a QLineEdit.

Calls C++ function: bool QMetaProperty::isUser() const.

C++ documentation:

Returns true if this property is designated as the USER property, i.e., the one that the user can edit for object or that is significant in some other way. Otherwise it returns false. e.g., the text property is the USER editable property of a QLineEdit.

If object is null, the function returns false if the Q_PROPERTY()'s USER attribute is false. Otherwise it returns true.

See also QMetaObject::userProperty(), isDesignable(), and isScriptable().

source

pub unsafe fn is_valid(&self) -> bool

Returns true if this property is valid (readable); otherwise returns false.

Calls C++ function: bool QMetaProperty::isValid() const.

C++ documentation:

Returns true if this property is valid (readable); otherwise returns false.

See also isReadable().

source

pub unsafe fn is_writable(&self) -> bool

Returns true if this property is writable; otherwise returns false.

Calls C++ function: bool QMetaProperty::isWritable() const.

C++ documentation:

Returns true if this property is writable; otherwise returns false.

See also isReadable() and write().

source

pub unsafe fn name(&self) -> *const c_char

Returns this property's name.

Calls C++ function: const char* QMetaProperty::name() const.

C++ documentation:

Returns this property’s name.

See also type() and typeName().

source

pub unsafe fn new() -> CppBox<QMetaProperty>

Calls C++ function: [constructor] void QMetaProperty::QMetaProperty().

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QMetaProperty>> ) -> CppBox<QMetaProperty>

The QMetaProperty class provides meta-data about a property.

Calls C++ function: [constructor] void QMetaProperty::QMetaProperty(const QMetaProperty& other).

C++ documentation:

The QMetaProperty class provides meta-data about a property.

Property meta-data is obtained from an object's meta-object. See QMetaObject::property() and QMetaObject::propertyCount() for details.

source

pub unsafe fn notify_signal(&self) -> CppBox<QMetaMethod>

Returns the QMetaMethod instance of the property change notifying signal if one was specified, otherwise returns an invalid QMetaMethod.

Calls C++ function: QMetaMethod QMetaProperty::notifySignal() const.

C++ documentation:

Returns the QMetaMethod instance of the property change notifying signal if one was specified, otherwise returns an invalid QMetaMethod.

This function was introduced in Qt 4.5.

See also hasNotifySignal().

source

pub unsafe fn notify_signal_index(&self) -> c_int

Returns the index of the property change notifying signal if one was specified, otherwise returns -1.

Calls C++ function: int QMetaProperty::notifySignalIndex() const.

C++ documentation:

Returns the index of the property change notifying signal if one was specified, otherwise returns -1.

This function was introduced in Qt 4.6.

See also hasNotifySignal().

source

pub unsafe fn property_index(&self) -> c_int

Returns this property's index.

Calls C++ function: int QMetaProperty::propertyIndex() const.

C++ documentation:

Returns this property’s index.

This function was introduced in Qt 4.6.

source

pub unsafe fn read(&self, obj: impl CastInto<Ptr<QObject>>) -> CppBox<QVariant>

Reads the property's value from the given object. Returns the value if it was able to read it; otherwise returns an invalid variant.

Calls C++ function: QVariant QMetaProperty::read(const QObject* obj) const.

C++ documentation:

Reads the property’s value from the given object. Returns the value if it was able to read it; otherwise returns an invalid variant.

See also write(), reset(), and isReadable().

source

pub unsafe fn read_on_gadget(&self, gadget: *const c_void) -> CppBox<QVariant>

Reads the property's value from the given gadget. Returns the value if it was able to read it; otherwise returns an invalid variant.

Calls C++ function: QVariant QMetaProperty::readOnGadget(const void* gadget) const.

C++ documentation:

Reads the property’s value from the given gadget. Returns the value if it was able to read it; otherwise returns an invalid variant.

This function should only be used if this is a property of a Q_GADGET

This function was introduced in Qt 5.5.

source

pub unsafe fn relative_property_index(&self) -> c_int

Available on cpp_lib_version="5.14.0" only.

Returns this property's index relative within the enclosing meta object.

Calls C++ function: int QMetaProperty::relativePropertyIndex() const.

C++ documentation:

Returns this property’s index relative within the enclosing meta object.

This function was introduced in Qt 5.14.

source

pub unsafe fn reset(&self, obj: impl CastInto<Ptr<QObject>>) -> bool

Resets the property for the given object with a reset method. Returns true if the reset worked; otherwise returns false.

Calls C++ function: bool QMetaProperty::reset(QObject* obj) const.

C++ documentation:

Resets the property for the given object with a reset method. Returns true if the reset worked; otherwise returns false.

Reset methods are optional; only a few properties support them.

See also read() and write().

source

pub unsafe fn reset_on_gadget(&self, gadget: *mut c_void) -> bool

Resets the property for the given gadget with a reset method. Returns true if the reset worked; otherwise returns false.

Calls C++ function: bool QMetaProperty::resetOnGadget(void* gadget) const.

C++ documentation:

Resets the property for the given gadget with a reset method. Returns true if the reset worked; otherwise returns false.

Reset methods are optional; only a few properties support them.

This function should only be used if this is a property of a Q_GADGET

This function was introduced in Qt 5.5.

source

pub unsafe fn revision(&self) -> c_int

Returns the property revision if one was specified by REVISION, otherwise returns 0.

Calls C++ function: int QMetaProperty::revision() const.

C++ documentation:

Returns the property revision if one was specified by REVISION, otherwise returns 0.

This function was introduced in Qt 5.1.

source

pub unsafe fn type_(&self) -> Type

Returns this property's type. The return value is one of the values of the QVariant::Type enumeration.

Calls C++ function: QVariant::Type QMetaProperty::type() const.

C++ documentation:

Returns this property’s type. The return value is one of the values of the QVariant::Type enumeration.

See also userType(), typeName(), and name().

source

pub unsafe fn type_name(&self) -> *const c_char

Returns the name of this property's type.

Calls C++ function: const char* QMetaProperty::typeName() const.

C++ documentation:

Returns the name of this property’s type.

See also type() and name().

source

pub unsafe fn user_type(&self) -> c_int

Returns this property's user type. The return value is one of the values that are registered with QMetaType, or QMetaType::UnknownType if the type is not registered.

Calls C++ function: int QMetaProperty::userType() const.

C++ documentation:

Returns this property’s user type. The return value is one of the values that are registered with QMetaType, or QMetaType::UnknownType if the type is not registered.

This function was introduced in Qt 4.2.

See also type(), QMetaType, and typeName().

source

pub unsafe fn write( &self, obj: impl CastInto<Ptr<QObject>>, value: impl CastInto<Ref<QVariant>> ) -> bool

Writes value as the property's value to the given object. Returns true if the write succeeded; otherwise returns false.

Calls C++ function: bool QMetaProperty::write(QObject* obj, const QVariant& value) const.

C++ documentation:

Writes value as the property’s value to the given object. Returns true if the write succeeded; otherwise returns false.

If value is not of the same type type as the property, a conversion is attempted. An empty QVariant() is equivalent to a call to reset() if this property is resetable, or setting a default-constructed object otherwise.

See also read(), reset(), and isWritable().

source

pub unsafe fn write_on_gadget( &self, gadget: *mut c_void, value: impl CastInto<Ref<QVariant>> ) -> bool

Writes value as the property's value to the given gadget. Returns true if the write succeeded; otherwise returns false.

Calls C++ function: bool QMetaProperty::writeOnGadget(void* gadget, const QVariant& value) const.

C++ documentation:

Writes value as the property’s value to the given gadget. Returns true if the write succeeded; otherwise returns false.

This function should only be used if this is a property of a Q_GADGET

This function was introduced in Qt 5.5.

Trait Implementations§

source§

impl CppDeletable for QMetaProperty

source§

unsafe fn delete(&self)

The QMetaProperty class provides meta-data about a property.

Calls C++ function: [destructor] void QMetaProperty::~QMetaProperty().

C++ documentation:

The QMetaProperty class provides meta-data about a property.

Property meta-data is obtained from an object's meta-object. See QMetaObject::property() and QMetaObject::propertyCount() for details.

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, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. 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> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

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

§

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>,

§

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.