KLayout 0.29.8 (2024-10-28 63dd591e5) [master]

API reference - Class QMetaType

Notation used in Ruby API documentation

Module: QtCore

Description: Binding of QMetaType

Sub-classes: TypeFlag, QFlags_TypeFlag

Public constructors

new QMetaTypenew(int type)Constructor QMetaType::QMetaType(const int type)

Public methods

[const]QMetaType ptr_const_castReturns a non-const reference 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.
[const]void *construct(void * where,
void * copy = nullptr)
Method void *QMetaType::construct(void *where, const void *copy)
[const]void *create(void * copy = nullptr)Method void *QMetaType::create(const void *copy)
[const]voiddestroy(void * data)Method void QMetaType::destroy(void *data)
[const]voiddestruct(void * data)Method void QMetaType::destruct(void *data)
[const]QMetaType_QFlags_TypeFlagflagsMethod QFlags<QMetaType::TypeFlag> QMetaType::flags()
[const]boolisRegistered?Method bool QMetaType::isRegistered()
[const]boolisValid?Method bool QMetaType::isValid()
[const]void *qt_create(void * copy = nullptr)Method void *QMetaType::create(const void *copy)
[const]voidqt_destroy(void * data)Method void QMetaType::destroy(void *data)
[const]intsizeOfMethod int QMetaType::sizeOf()

Public static methods and constants

[static,const]QMetaType_TypeFlagIsEnumerationEnum constant QMetaType::IsEnumeration
[static,const]QMetaType_TypeFlagIsGadgetEnum constant QMetaType::IsGadget
[static,const]QMetaType_TypeFlagMovableTypeEnum constant QMetaType::MovableType
[static,const]QMetaType_TypeFlagNeedsConstructionEnum constant QMetaType::NeedsConstruction
[static,const]QMetaType_TypeFlagNeedsDestructionEnum constant QMetaType::NeedsDestruction
[static,const]QMetaType_TypeFlagPointerToGadgetEnum constant QMetaType::PointerToGadget
[static,const]QMetaType_TypeFlagPointerToQObjectEnum constant QMetaType::PointerToQObject
[static,const]QMetaType_TypeFlagSharedPointerToQObjectEnum constant QMetaType::SharedPointerToQObject
[static,const]QMetaType_TypeFlagTrackingPointerToQObjectEnum constant QMetaType::TrackingPointerToQObject
[static,const]QMetaType_TypeFlagWasDeclaredAsMetaTypeEnum constant QMetaType::WasDeclaredAsMetaType
[static,const]QMetaType_TypeFlagWeakPointerToQObjectEnum constant QMetaType::WeakPointerToQObject
boolcompare(void * lhs,
void * rhs,
int typeId,
int ptr result)
Static method bool QMetaType::compare(const void *lhs, const void *rhs, int typeId, int *result)
void *construct(int type,
void * where,
void * copy)
Static method void *QMetaType::construct(int type, void *where, const void *copy)
boolconvert(void * from,
int fromTypeId,
void * to,
int toTypeId)
Static method bool QMetaType::convert(const void *from, int fromTypeId, void *to, int toTypeId)
void *create(int type,
void * copy = nullptr)
Static method void *QMetaType::create(int type, const void *copy)
booldebugStream(QDebug dbg,
void * rhs,
int typeId)
Static method bool QMetaType::debugStream(QDebug &dbg, const void *rhs, int typeId)
voiddestroy(int type,
void * data)
Static method void QMetaType::destroy(int type, void *data)
voiddestruct(int type,
void * where)
Static method void QMetaType::destruct(int type, void *where)
boolequals(void * lhs,
void * rhs,
int typeId,
int ptr result)
Static method bool QMetaType::equals(const void *lhs, const void *rhs, int typeId, int *result)
boolhasRegisteredComparators(int typeId)Static method bool QMetaType::hasRegisteredComparators(int typeId)
boolhasRegisteredConverterFunction(int fromTypeId,
int toTypeId)
Static method bool QMetaType::hasRegisteredConverterFunction(int fromTypeId, int toTypeId)
boolhasRegisteredDebugStreamOperator(int typeId)Static method bool QMetaType::hasRegisteredDebugStreamOperator(int typeId)
boolisRegistered?(int type)Static method bool QMetaType::isRegistered(int type)
boolload(QDataStream stream,
int type,
void * data)
Static method bool QMetaType::load(QDataStream &stream, int type, void *data)
void *qt_create(int type,
void * copy = nullptr)
Static method void *QMetaType::create(int type, const void *copy)
voidqt_destroy(int type,
void * data)
Static method void QMetaType::destroy(int type, void *data)
boolsave(QDataStream stream,
int type,
void * data)
Static method bool QMetaType::save(QDataStream &stream, int type, const void *data)
intsizeOf(int type)Static method int QMetaType::sizeOf(int type)
inttype(string typeName)Static method int QMetaType::type(const char *typeName)
inttype(bytes typeName)Static method int QMetaType::type(const ::QByteArray &typeName)
QMetaType_QFlags_TypeFlagtypeFlags(int type)Static method QFlags<QMetaType::TypeFlag> QMetaType::typeFlags(int type)
stringtypeName(int type)Static method const char *QMetaType::typeName(int type)
boolunregisterType(int type)Static method bool QMetaType::unregisterType(int type)

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

[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

IsEnumeration

Signature: [static,const] QMetaType_TypeFlag IsEnumeration

Description: Enum constant QMetaType::IsEnumeration

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

IsGadget

Signature: [static,const] QMetaType_TypeFlag IsGadget

Description: Enum constant QMetaType::IsGadget

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

MovableType

Signature: [static,const] QMetaType_TypeFlag MovableType

Description: Enum constant QMetaType::MovableType

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

NeedsConstruction

Signature: [static,const] QMetaType_TypeFlag NeedsConstruction

Description: Enum constant QMetaType::NeedsConstruction

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

NeedsDestruction

Signature: [static,const] QMetaType_TypeFlag NeedsDestruction

Description: Enum constant QMetaType::NeedsDestruction

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

PointerToGadget

Signature: [static,const] QMetaType_TypeFlag PointerToGadget

Description: Enum constant QMetaType::PointerToGadget

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

PointerToQObject

Signature: [static,const] QMetaType_TypeFlag PointerToQObject

Description: Enum constant QMetaType::PointerToQObject

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

SharedPointerToQObject

Signature: [static,const] QMetaType_TypeFlag SharedPointerToQObject

Description: Enum constant QMetaType::SharedPointerToQObject

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

TrackingPointerToQObject

Signature: [static,const] QMetaType_TypeFlag TrackingPointerToQObject

Description: Enum constant QMetaType::TrackingPointerToQObject

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

WasDeclaredAsMetaType

Signature: [static,const] QMetaType_TypeFlag WasDeclaredAsMetaType

Description: Enum constant QMetaType::WasDeclaredAsMetaType

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

WeakPointerToQObject

Signature: [static,const] QMetaType_TypeFlag WeakPointerToQObject

Description: Enum constant QMetaType::WeakPointerToQObject

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

_const_cast

Signature: [const] QMetaType ptr _const_cast

Description: Returns a non-const reference to self.

Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects.

This method has been introduced in version 0.29.6.

_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.

compare

Signature: [static] bool compare (void * lhs, void * rhs, int typeId, int ptr result)

Description: Static method bool QMetaType::compare(const void *lhs, const void *rhs, int typeId, int *result)

This method is static and can be called without an instance.

construct

(1) Signature: [const] void * construct (void * where, void * copy = nullptr)

Description: Method void *QMetaType::construct(void *where, const void *copy)

Python specific notes:
This instance method is available as '_inst_construct' in Python.

(2) Signature: [static] void * construct (int type, void * where, void * copy)

Description: Static method void *QMetaType::construct(int type, void *where, const void *copy)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_construct' in Python.

convert

Signature: [static] bool convert (void * from, int fromTypeId, void * to, int toTypeId)

Description: Static method bool QMetaType::convert(const void *from, int fromTypeId, void *to, int toTypeId)

This method is static and can be called without an instance.

create

(1) Signature: [const] void * create (void * copy = nullptr)

Description: Method void *QMetaType::create(const void *copy)

Python specific notes:
This instance method is available as '_inst_create' in Python.
This instance method is available as '_inst_qt_create' in Python.

(2) Signature: [static] void * create (int type, void * copy = nullptr)

Description: Static method void *QMetaType::create(int type, const void *copy)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_create' in Python.
This class method is available as '_class_qt_create' in Python.

debugStream

Signature: [static] bool debugStream (QDebug dbg, void * rhs, int typeId)

Description: Static method bool QMetaType::debugStream(QDebug &dbg, const void *rhs, int typeId)

This method is static and can be called without an instance.

destroy

(1) Signature: [const] void destroy (void * data)

Description: Method void QMetaType::destroy(void *data)

Python specific notes:
This instance method is available as '_inst_destroy' in Python.
This instance method is available as '_inst_qt_destroy' in Python.

(2) Signature: [static] void destroy (int type, void * data)

Description: Static method void QMetaType::destroy(int type, void *data)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_destroy' in Python.
This class method is available as '_class_qt_destroy' in Python.

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.

destruct

(1) Signature: [const] void destruct (void * data)

Description: Method void QMetaType::destruct(void *data)

Python specific notes:
This instance method is available as '_inst_destruct' in Python.

(2) Signature: [static] void destruct (int type, void * where)

Description: Static method void QMetaType::destruct(int type, void *where)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_destruct' in Python.

equals

Signature: [static] bool equals (void * lhs, void * rhs, int typeId, int ptr result)

Description: Static method bool QMetaType::equals(const void *lhs, const void *rhs, int typeId, int *result)

This method is static and can be called without an instance.

flags

Signature: [const] QMetaType_QFlags_TypeFlag flags

Description: Method QFlags<QMetaType::TypeFlag> QMetaType::flags()

hasRegisteredComparators

Signature: [static] bool hasRegisteredComparators (int typeId)

Description: Static method bool QMetaType::hasRegisteredComparators(int typeId)

This method is static and can be called without an instance.

hasRegisteredConverterFunction

Signature: [static] bool hasRegisteredConverterFunction (int fromTypeId, int toTypeId)

Description: Static method bool QMetaType::hasRegisteredConverterFunction(int fromTypeId, int toTypeId)

This method is static and can be called without an instance.

hasRegisteredDebugStreamOperator

Signature: [static] bool hasRegisteredDebugStreamOperator (int typeId)

Description: Static method bool QMetaType::hasRegisteredDebugStreamOperator(int typeId)

This method is static and can be called without an instance.

isRegistered?

(1) Signature: [const] bool isRegistered?

Description: Method bool QMetaType::isRegistered()

Python specific notes:
This instance method is available as '_inst_isRegistered' in Python.

(2) Signature: [static] bool isRegistered? (int type)

Description: Static method bool QMetaType::isRegistered(int type)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_isRegistered' in Python.

isValid?

Signature: [const] bool isValid?

Description: Method bool QMetaType::isValid()

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.

load

Signature: [static] bool load (QDataStream stream, int type, void * data)

Description: Static method bool QMetaType::load(QDataStream &stream, int type, void *data)

This method is static and can be called without an instance.

new

Signature: [static] new QMetaType new (int type)

Description: Constructor QMetaType::QMetaType(const int type)

This method creates an object of class QMetaType.

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

qt_create

(1) Signature: [const] void * qt_create (void * copy = nullptr)

Description: Method void *QMetaType::create(const void *copy)

Python specific notes:
This instance method is available as '_inst_create' in Python.
This instance method is available as '_inst_qt_create' in Python.

(2) Signature: [static] void * qt_create (int type, void * copy = nullptr)

Description: Static method void *QMetaType::create(int type, const void *copy)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_create' in Python.
This class method is available as '_class_qt_create' in Python.

qt_destroy

(1) Signature: [const] void qt_destroy (void * data)

Description: Method void QMetaType::destroy(void *data)

Python specific notes:
This instance method is available as '_inst_destroy' in Python.
This instance method is available as '_inst_qt_destroy' in Python.

(2) Signature: [static] void qt_destroy (int type, void * data)

Description: Static method void QMetaType::destroy(int type, void *data)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_destroy' in Python.
This class method is available as '_class_qt_destroy' in Python.

save

Signature: [static] bool save (QDataStream stream, int type, void * data)

Description: Static method bool QMetaType::save(QDataStream &stream, int type, const void *data)

This method is static and can be called without an instance.

sizeOf

(1) Signature: [const] int sizeOf

Description: Method int QMetaType::sizeOf()

Python specific notes:
This instance method is available as '_inst_sizeOf' in Python.

(2) Signature: [static] int sizeOf (int type)

Description: Static method int QMetaType::sizeOf(int type)

This method is static and can be called without an instance.

Python specific notes:
This class method is available as '_class_sizeOf' in Python.

type

(1) Signature: [static] int type (string typeName)

Description: Static method int QMetaType::type(const char *typeName)

This method is static and can be called without an instance.

(2) Signature: [static] int type (bytes typeName)

Description: Static method int QMetaType::type(const ::QByteArray &typeName)

This method is static and can be called without an instance.

typeFlags

Signature: [static] QMetaType_QFlags_TypeFlag typeFlags (int type)

Description: Static method QFlags<QMetaType::TypeFlag> QMetaType::typeFlags(int type)

This method is static and can be called without an instance.

typeName

Signature: [static] string typeName (int type)

Description: Static method const char *QMetaType::typeName(int type)

This method is static and can be called without an instance.

unregisterType

Signature: [static] bool unregisterType (int type)

Description: Static method bool QMetaType::unregisterType(int type)

This method is static and can be called without an instance.