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
.
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
impl QMetaProperty
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QMetaProperty>>
) -> Ref<QMetaProperty>
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)
.
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.
sourcepub unsafe fn enclosing_meta_object(&self) -> Ptr<QMetaObject>
pub unsafe fn enclosing_meta_object(&self) -> Ptr<QMetaObject>
Calls C++ function: const QMetaObject* QMetaProperty::enclosingMetaObject() const
.
sourcepub unsafe fn enumerator(&self) -> CppBox<QMetaEnum>
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
.
Returns the enumerator if this property’s type is an enumerator type; otherwise the returned value is undefined.
See also isEnumType() and isFlagType().
sourcepub unsafe fn has_notify_signal(&self) -> bool
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
.
Returns true
if this property has a corresponding change notify signal; otherwise returns false
.
See also notifySignal().
sourcepub unsafe fn has_std_cpp_set(&self) -> bool
pub unsafe fn has_std_cpp_set(&self) -> bool
Calls C++ function: bool QMetaProperty::hasStdCppSet() const
.
sourcepub unsafe fn is_constant(&self) -> bool
pub unsafe fn is_constant(&self) -> bool
Returns true
if the property is constant; otherwise returns false
.
Calls C++ function: bool QMetaProperty::isConstant() const
.
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.
sourcepub unsafe fn is_designable_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool
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
.
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().
sourcepub unsafe fn is_designable_0a(&self) -> bool
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
.
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().
sourcepub unsafe fn is_editable_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool
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
.
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().
sourcepub unsafe fn is_editable_0a(&self) -> bool
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
.
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().
sourcepub unsafe fn is_enum_type(&self) -> bool
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
.
Returns true
if the property’s type is an enumeration value; otherwise returns false
.
See also enumerator() and isFlagType().
sourcepub unsafe fn is_final(&self) -> bool
pub unsafe fn is_final(&self) -> bool
Returns true
if the property is final; otherwise returns false
.
Calls C++ function: bool QMetaProperty::isFinal() const
.
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.
sourcepub unsafe fn is_flag_type(&self) -> bool
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
.
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().
sourcepub unsafe fn is_readable(&self) -> bool
pub unsafe fn is_readable(&self) -> bool
Returns true
if this property is readable; otherwise returns false
.
Calls C++ function: bool QMetaProperty::isReadable() const
.
Returns true
if this property is readable; otherwise returns false
.
See also isWritable(), read(), and isValid().
sourcepub unsafe fn is_resettable(&self) -> bool
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
.
Returns true
if this property can be reset to a default value; otherwise returns false
.
See also reset().
sourcepub unsafe fn is_scriptable_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool
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
.
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().
sourcepub unsafe fn is_scriptable_0a(&self) -> bool
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
.
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().
sourcepub unsafe fn is_stored_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool
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
.
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().
sourcepub unsafe fn is_stored_0a(&self) -> bool
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
.
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().
sourcepub unsafe fn is_user_1a(&self, obj: impl CastInto<Ptr<QObject>>) -> bool
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
.
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().
sourcepub unsafe fn is_user_0a(&self) -> bool
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
.
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().
sourcepub unsafe fn is_valid(&self) -> bool
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
.
Returns true
if this property is valid (readable); otherwise returns false
.
See also isReadable().
sourcepub unsafe fn is_writable(&self) -> bool
pub unsafe fn is_writable(&self) -> bool
Returns true
if this property is writable; otherwise returns false.
Calls C++ function: bool QMetaProperty::isWritable() const
.
Returns true
if this property is writable; otherwise returns false.
See also isReadable() and write().
sourcepub unsafe fn name(&self) -> *const c_char
pub unsafe fn name(&self) -> *const c_char
Returns this property's name.
Calls C++ function: const char* QMetaProperty::name() const
.
sourcepub unsafe fn new() -> CppBox<QMetaProperty>
pub unsafe fn new() -> CppBox<QMetaProperty>
Calls C++ function: [constructor] void QMetaProperty::QMetaProperty()
.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QMetaProperty>>
) -> CppBox<QMetaProperty>
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)
.
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.
sourcepub unsafe fn notify_signal(&self) -> CppBox<QMetaMethod>
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
.
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().
sourcepub unsafe fn notify_signal_index(&self) -> c_int
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
.
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().
sourcepub unsafe fn property_index(&self) -> c_int
pub unsafe fn property_index(&self) -> c_int
Returns this property's index.
Calls C++ function: int QMetaProperty::propertyIndex() const
.
Returns this property’s index.
This function was introduced in Qt 4.6.
sourcepub unsafe fn read(&self, obj: impl CastInto<Ptr<QObject>>) -> CppBox<QVariant>
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
.
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().
sourcepub unsafe fn read_on_gadget(&self, gadget: *const c_void) -> CppBox<QVariant>
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
.
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.
sourcepub unsafe fn relative_property_index(&self) -> c_int
Available on cpp_lib_version="5.14.0"
only.
pub unsafe fn relative_property_index(&self) -> c_int
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
.
Returns this property’s index relative within the enclosing meta object.
This function was introduced in Qt 5.14.
sourcepub unsafe fn reset(&self, obj: impl CastInto<Ptr<QObject>>) -> bool
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
.
sourcepub unsafe fn reset_on_gadget(&self, gadget: *mut c_void) -> bool
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
.
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.
sourcepub unsafe fn revision(&self) -> c_int
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
.
Returns the property revision if one was specified by REVISION, otherwise returns 0.
This function was introduced in Qt 5.1.
sourcepub unsafe fn type_(&self) -> Type
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
.
sourcepub unsafe fn type_name(&self) -> *const c_char
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
.
sourcepub unsafe fn user_type(&self) -> c_int
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
.
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.
sourcepub unsafe fn write(
&self,
obj: impl CastInto<Ptr<QObject>>,
value: impl CastInto<Ref<QVariant>>
) -> bool
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
.
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().
sourcepub unsafe fn write_on_gadget(
&self,
gadget: *mut c_void,
value: impl CastInto<Ref<QVariant>>
) -> bool
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
.
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
impl CppDeletable for QMetaProperty
source§unsafe fn delete(&self)
unsafe fn delete(&self)
The QMetaProperty class provides meta-data about a property.
Calls C++ function: [destructor] void QMetaProperty::~QMetaProperty()
.
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.