![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qmetaobjectbuilder_p.h>
Public Types | |
enum | AddMember { ClassName = 0x00000001 , SuperClass = 0x00000002 , Methods = 0x00000004 , Signals = 0x00000008 , Slots = 0x00000010 , Constructors = 0x00000020 , Properties = 0x00000040 , Enumerators = 0x00000080 , ClassInfos = 0x00000100 , RelatedMetaObjects = 0x00000200 , StaticMetacall = 0x00000400 , PublicMethods = 0x00000800 , ProtectedMethods = 0x00001000 , PrivateMethods = 0x00002000 , AllMembers = 0x7FFFFFFF , AllPrimaryMembers = 0x7FFFFBFC } |
This enum defines which members of QMetaObject should be copied by QMetaObjectBuilder::addMetaObject() More... | |
typedef void(* | StaticMetacallFunction) (QObject *, QMetaObject::Call, int, void **) |
Typedef for static metacall functions. | |
Public Member Functions | |
QMetaObjectBuilder () | |
Constructs a new QMetaObjectBuilder. | |
QMetaObjectBuilder (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members=AllMembers) | |
Constructs a new QMetaObjectBuilder which is a copy of the meta object information in prototype. | |
virtual | ~QMetaObjectBuilder () |
Destroys this meta object builder. | |
QByteArray | className () const |
Returns the name of the class being constructed by this meta object builder. | |
void | setClassName (const QByteArray &name) |
Sets the name of the class being constructed by this meta object builder. | |
const QMetaObject * | superClass () const |
Returns the superclass meta object of the class being constructed by this meta object builder. | |
void | setSuperClass (const QMetaObject *meta) |
Sets the superclass meta object of the class being constructed by this meta object builder to meta. | |
MetaObjectFlags | flags () const |
Returns the flags of the class being constructed by this meta object builder. | |
void | setFlags (MetaObjectFlags) |
Sets the flags of the class being constructed by this meta object builder. | |
int | methodCount () const |
Returns the number of methods in this class, excluding the number of methods in the base class. | |
int | constructorCount () const |
Returns the number of constructors in this class. | |
int | propertyCount () const |
Returns the number of properties in this class, excluding the number of properties in the base class. | |
int | enumeratorCount () const |
Returns the number of enumerators in this class, excluding the number of enumerators in the base class. | |
int | classInfoCount () const |
Returns the number of items of class information in this class, exclusing the number of items of class information in the base class. | |
int | relatedMetaObjectCount () const |
Returns the number of related meta objects that are associated with this class. | |
QMetaMethodBuilder | addMethod (const QByteArray &signature) |
Adds a new public method to this class with the specified signature. | |
QMetaMethodBuilder | addMethod (const QByteArray &signature, const QByteArray &returnType) |
Adds a new public method to this class with the specified signature and returnType. | |
QMetaMethodBuilder | addMethod (const QMetaMethod &prototype) |
Adds a new public method to this class that has the same information as prototype. | |
QMetaMethodBuilder | addSlot (const QByteArray &signature) |
Adds a new public slot to this class with the specified signature. | |
QMetaMethodBuilder | addSignal (const QByteArray &signature) |
Adds a new signal to this class with the specified signature. | |
QMetaMethodBuilder | addConstructor (const QByteArray &signature) |
Adds a new constructor to this class with the specified signature. | |
QMetaMethodBuilder | addConstructor (const QMetaMethod &prototype) |
Adds a new constructor to this class that has the same information as prototype. | |
QMetaPropertyBuilder | addProperty (const QByteArray &name, const QByteArray &type, int notifierId=-1) |
Adds a new readable/writable property to this class with the specified name and type. | |
QMetaPropertyBuilder | addProperty (const QByteArray &name, const QByteArray &type, QMetaType metaType, int notifierId=-1) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QMetaPropertyBuilder | addProperty (const QMetaProperty &prototype) |
Adds a new property to this class that has the same information as prototype. | |
QMetaEnumBuilder | addEnumerator (const QByteArray &name) |
Adds a new enumerator to this class with the specified name. | |
QMetaEnumBuilder | addEnumerator (const QMetaEnum &prototype) |
Adds a new enumerator to this class that has the same information as prototype. | |
int | addClassInfo (const QByteArray &name, const QByteArray &value) |
Adds name and value as an item of class information to this class. | |
int | addRelatedMetaObject (const QMetaObject *meta) |
Adds meta to this class as a related meta object. | |
void | addMetaObject (const QMetaObject *prototype, QMetaObjectBuilder::AddMembers members=AllMembers) |
Adds the contents of prototype to this meta object builder. | |
QMetaMethodBuilder | method (int index) const |
Returns the method at index in this class. | |
QMetaMethodBuilder | constructor (int index) const |
Returns the constructor at index in this class. | |
QMetaPropertyBuilder | property (int index) const |
Returns the property at index in this class. | |
QMetaEnumBuilder | enumerator (int index) const |
Returns the enumerator at index in this class. | |
const QMetaObject * | relatedMetaObject (int index) const |
Returns the related meta object at index in this class. | |
QByteArray | classInfoName (int index) const |
Returns the name of the item of class information at index in this class. | |
QByteArray | classInfoValue (int index) const |
Returns the value of the item of class information at index in this class. | |
void | removeMethod (int index) |
Removes the method at index from this class. | |
void | removeConstructor (int index) |
Removes the constructor at index from this class. | |
void | removeProperty (int index) |
Removes the property at index from this class. | |
void | removeEnumerator (int index) |
Removes the enumerator at index from this class. | |
void | removeClassInfo (int index) |
Removes the item of class information at index from this class. | |
void | removeRelatedMetaObject (int index) |
Removes the related meta object at index from this class. | |
int | indexOfMethod (const QByteArray &signature) |
Finds a method with the specified signature and returns its index; otherwise returns -1. | |
int | indexOfSignal (const QByteArray &signature) |
Finds a signal with the specified signature and returns its index; otherwise returns -1. | |
int | indexOfSlot (const QByteArray &signature) |
Finds a slot with the specified signature and returns its index; otherwise returns -1. | |
int | indexOfConstructor (const QByteArray &signature) |
Finds a constructor with the specified signature and returns its index; otherwise returns -1. | |
int | indexOfProperty (const QByteArray &name) |
Finds a property with the specified name and returns its index; otherwise returns -1. | |
int | indexOfEnumerator (const QByteArray &name) |
Finds an enumerator with the specified name and returns its index; otherwise returns -1. | |
int | indexOfClassInfo (const QByteArray &name) |
Finds an item of class information with the specified name and returns its index; otherwise returns -1. | |
QMetaObjectBuilder::StaticMetacallFunction | staticMetacallFunction () const |
Returns the static metacall function to use to construct objects of this class. | |
void | setStaticMetacallFunction (QMetaObjectBuilder::StaticMetacallFunction value) |
Sets the static metacall function to use to construct objects of this class to value. | |
QMetaObject * | toMetaObject () const |
Converts this meta object builder into a concrete QMetaObject. | |
Friends | |
class | QMetaMethodBuilder |
class | QMetaPropertyBuilder |
class | QMetaEnumBuilder |
\inmodule QtCore
The QMetaObjectBuilder class supports building QMetaObject objects at runtime.
Definition at line 37 of file qmetaobjectbuilder_p.h.
QMetaObjectBuilder::StaticMetacallFunction |
Typedef for static metacall functions.
The three parameters are the call type value, the constructor index, and the array of parameters.
Definition at line 128 of file qmetaobjectbuilder_p.h.
This enum defines which members of QMetaObject should be copied by QMetaObjectBuilder::addMetaObject()
\value ClassName Add the class name. \value SuperClass Add the super class. \value Methods Add methods that aren't signals or slots. \value Signals Add signals. \value Slots Add slots. \value Constructors Add constructors. \value Properties Add properties. \value Enumerators Add enumerators. \value ClassInfos Add items of class information. \value RelatedMetaObjects Add related meta objects. \value StaticMetacall Add the static metacall function. \value PublicMethods Add public methods (ignored for signals). \value ProtectedMethods Add protected methods (ignored for signals). \value PrivateMethods All private methods (ignored for signals). \value AllMembers Add all members. \value AllPrimaryMembers Add everything except the class name, super class, and static metacall function.
Definition at line 40 of file qmetaobjectbuilder_p.h.
QMetaObjectBuilder::QMetaObjectBuilder | ( | ) |
Constructs a new QMetaObjectBuilder.
Definition at line 207 of file qmetaobjectbuilder.cpp.
|
explicit |
Constructs a new QMetaObjectBuilder which is a copy of the meta object information in prototype.
Note: the super class contents for prototype are not copied, only the immediate class that is defined by prototype.
The members parameter indicates which members of prototype should be added. The default is AllMembers.
Definition at line 223 of file qmetaobjectbuilder.cpp.
References addMetaObject(), and members().
|
virtual |
Destroys this meta object builder.
Definition at line 233 of file qmetaobjectbuilder.cpp.
int QMetaObjectBuilder::addClassInfo | ( | const QByteArray & | name, |
const QByteArray & | value | ||
) |
Adds name and value as an item of class information to this class.
Returns the index of the new item of class information.
Definition at line 617 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::classInfoNames, QMetaObjectBuilderPrivate::classInfoValues, and QList< T >::size().
Referenced by addMetaObject(), QQmlMetaType::clone(), and QQmlPropertyCache::toMetaObjectBuilder().
QMetaMethodBuilder QMetaObjectBuilder::addConstructor | ( | const QByteArray & | signature | ) |
Adds a new constructor to this class with the specified signature.
Returns an object that can be used to adjust the other attributes of the constructor. The signature will be normalized before it is added to the class.
Definition at line 483 of file qmetaobjectbuilder.cpp.
References QMetaMethod::Constructor, QMetaObjectBuilderPrivate::constructors, and QMetaMethodBuilder.
Referenced by addConstructor(), addMetaObject(), and addMethod().
QMetaMethodBuilder QMetaObjectBuilder::addConstructor | ( | const QMetaMethod & | prototype | ) |
Adds a new constructor to this class that has the same information as prototype.
This is used to clone the constructors of an existing QMetaObject. Returns an object that can be used to adjust the attributes of the constructor.
This function requires that prototype be a constructor.
Definition at line 502 of file qmetaobjectbuilder.cpp.
References QMetaMethod::access(), addConstructor(), QMetaMethod::attributes(), QMetaMethod::Constructor, QMetaMethod::methodSignature(), QMetaMethod::methodType(), QMetaMethod::parameterNames(), Q_ASSERT, QMetaMethodBuilder::setAccess(), QMetaMethodBuilder::setAttributes(), QMetaMethodBuilder::setParameterNames(), QMetaMethodBuilder::setReturnType(), QMetaMethodBuilder::setTag(), QMetaMethod::tag(), and QMetaMethod::typeName().
QMetaEnumBuilder QMetaObjectBuilder::addEnumerator | ( | const QByteArray & | name | ) |
Adds a new enumerator to this class with the specified name.
Returns an object that can be used to adjust the other attributes of the enumerator.
Definition at line 581 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::enumerators, and QMetaEnumBuilder.
Referenced by addEnumerator(), addMetaObject(), QQmlMetaType::clone(), and QQmlPropertyCache::toMetaObjectBuilder().
QMetaEnumBuilder QMetaObjectBuilder::addEnumerator | ( | const QMetaEnum & | prototype | ) |
Adds a new enumerator to this class that has the same information as prototype.
This is used to clone the enumerators of an existing QMetaObject. Returns an object that can be used to adjust the attributes of the enumerator.
Definition at line 597 of file qmetaobjectbuilder.cpp.
References addEnumerator(), QMetaEnumBuilder::addKey(), QMetaEnum::enumName(), QMetaEnum::isFlag(), QMetaEnum::isScoped(), QMetaEnum::key(), QMetaEnum::keyCount(), QMetaEnum::metaType(), QMetaEnum::name(), QMetaEnumBuilder::setEnumName(), QMetaEnumBuilder::setIsFlag(), QMetaEnumBuilder::setIsScoped(), QMetaEnumBuilder::setMetaType(), and QMetaEnum::value().
void QMetaObjectBuilder::addMetaObject | ( | const QMetaObject * | prototype, |
QMetaObjectBuilder::AddMembers | members = AllMembers |
||
) |
Adds the contents of prototype to this meta object builder.
This function is useful for cloning the contents of an existing QMetaObject.
The members parameter indicates which members of prototype should be added. The default is AllMembers.
Definition at line 651 of file qmetaobjectbuilder.cpp.
References addClassInfo(), addConstructor(), addEnumerator(), addMethod(), addProperty(), addRelatedMetaObject(), QMetaObject::classInfo(), QMetaObject::classInfoCount(), QMetaObject::classInfoOffset(), ClassInfos, QMetaObjectBuilderPrivate::className, ClassName, QMetaObject::className(), QMetaObject::constructor(), QMetaObject::constructorCount(), Constructors, QMetaObject::d, QMetaObject::Data::data, QMetaObject::enumerator(), QMetaObject::enumeratorCount(), QMetaObject::enumeratorOffset(), Enumerators, members(), QMetaMethod::Method, QMetaObject::method(), method, QMetaObject::methodCount(), QMetaObject::methodOffset(), Methods, QMetaClassInfo::name(), QMetaMethod::Private, PrivateMethods, Properties, QMetaObject::property(), QMetaObject::propertyCount(), QMetaObject::propertyOffset(), QMetaMethod::Protected, ProtectedMethods, QMetaMethod::Public, PublicMethods, Q_ASSERT, qmobPriv(), RelatedMetaObjects, QMetaObject::Data::relatedMetaObjects, QMetaObjectPrivate::revision, setStaticMetacallFunction(), QMetaMethod::Signal, Signals, QMetaMethod::Slot, Slots, QMetaObject::Data::static_metacall, StaticMetacall, QMetaObjectBuilderPrivate::superClass, SuperClass, QMetaObject::superClass(), and QMetaClassInfo::value().
Referenced by QMetaObjectBuilder().
QMetaMethodBuilder QMetaObjectBuilder::addMethod | ( | const QByteArray & | signature | ) |
Adds a new public method to this class with the specified signature.
Returns an object that can be used to adjust the other attributes of the method. The signature will be normalized before it is added to the class.
Definition at line 388 of file qmetaobjectbuilder.cpp.
References QMetaMethod::Method, QMetaObjectBuilderPrivate::methods, and QMetaMethodBuilder.
Referenced by addMetaObject(), addMethod(), addProperty(), and QQmlMetaType::clone().
QMetaMethodBuilder QMetaObjectBuilder::addMethod | ( | const QByteArray & | signature, |
const QByteArray & | returnType | ||
) |
Adds a new public method to this class with the specified signature and returnType.
Returns an object that can be used to adjust the other attributes of the method. The signature and returnType will be normalized before they are added to the class.
Definition at line 404 of file qmetaobjectbuilder.cpp.
References QMetaMethod::Method, QMetaObjectBuilderPrivate::methods, and QMetaMethodBuilder.
QMetaMethodBuilder QMetaObjectBuilder::addMethod | ( | const QMetaMethod & | prototype | ) |
Adds a new public method to this class that has the same information as prototype.
This is used to clone the methods of an existing QMetaObject. Returns an object that can be used to adjust the attributes of the method.
This function will detect if prototype is an ordinary method, signal, slot, or constructor and act accordingly.
Definition at line 423 of file qmetaobjectbuilder.cpp.
References QMetaMethod::access(), addConstructor(), addMethod(), addSignal(), addSlot(), QMetaMethod::attributes(), QMetaMethod::Constructor, QMetaMethod::Method, method, QMetaMethod::methodSignature(), QMetaMethod::methodType(), QMetaMethod::parameterNames(), QMetaMethod::revision(), QMetaMethod::Signal, QMetaMethod::Slot, QMetaMethod::tag(), and QMetaMethod::typeName().
QMetaPropertyBuilder QMetaObjectBuilder::addProperty | ( | const QByteArray & | name, |
const QByteArray & | type, | ||
int | notifierId = -1 |
||
) |
Adds a new readable/writable property to this class with the specified name and type.
Returns an object that can be used to adjust the other attributes of the property. The type will be normalized before it is added to the class. notifierId will be registered as the property's notify signal.
Definition at line 523 of file qmetaobjectbuilder.cpp.
References addProperty(), and QMetaType::fromName().
Referenced by addMetaObject(), addProperty(), addProperty(), QQmlAdaptorModelEngineData::addProperty(), QQmlMetaType::clone(), QQmlOpenMetaObjectType::createProperties(), QQmlDMObjectDataMetaObject::createProperty(), QQmlOpenMetaObjectType::createProperty(), QQmlDelegateModelItemMetaType::initializeMetaObject(), and QQmlPropertyCache::toMetaObjectBuilder().
QMetaPropertyBuilder QMetaObjectBuilder::addProperty | ( | const QByteArray & | name, |
const QByteArray & | type, | ||
QMetaType | metaType, | ||
int | notifierId = -1 |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 532 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::properties, and QMetaPropertyBuilder.
QMetaPropertyBuilder QMetaObjectBuilder::addProperty | ( | const QMetaProperty & | prototype | ) |
Adds a new property to this class that has the same information as prototype.
This is used to clone the properties of an existing QMetaObject. Returns an object that can be used to adjust the attributes of the property.
Definition at line 547 of file qmetaobjectbuilder.cpp.
References addMethod(), addProperty(), QMetaProperty::hasNotifySignal(), QMetaProperty::hasStdCppSet(), QMetaMethodBuilder::index(), indexOfMethod(), QMetaProperty::isConstant(), QMetaProperty::isDesignable(), QMetaProperty::isEnumType(), QMetaProperty::isFinal(), QMetaProperty::isReadable(), QMetaProperty::isResettable(), QMetaProperty::isScriptable(), QMetaProperty::isStored(), QMetaProperty::isUser(), QMetaProperty::isWritable(), QMetaProperty::metaType(), method, QMetaProperty::name(), QMetaProperty::notifySignal(), QMetaObjectBuilderPrivate::properties, property, QMetaProperty::revision(), and QMetaProperty::typeName().
int QMetaObjectBuilder::addRelatedMetaObject | ( | const QMetaObject * | meta | ) |
Adds meta to this class as a related meta object.
Returns the index of the new related meta object entry.
Related meta objects are used when resolving the enumerated type associated with a property, where the enumerated type is in a different class from the property.
Definition at line 636 of file qmetaobjectbuilder.cpp.
References QList< T >::append(), Q_ASSERT, QMetaObjectBuilderPrivate::relatedMetaObjects, and QList< T >::size().
Referenced by addMetaObject().
QMetaMethodBuilder QMetaObjectBuilder::addSignal | ( | const QByteArray & | signature | ) |
Adds a new signal to this class with the specified signature.
Returns an object that can be used to adjust the other attributes of the signal. The signature will be normalized before it is added to the class.
Definition at line 466 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::methods, QMetaMethod::Public, QMetaMethodBuilder, and QMetaMethod::Signal.
Referenced by addMethod(), QQmlAdaptorModelEngineData::addProperty(), QQmlOpenMetaObjectType::createProperties(), QQmlDMObjectDataMetaObject::createProperty(), QQmlOpenMetaObjectType::createProperty(), QQmlDelegateModelItemMetaType::initializeMetaObject(), and QQmlPropertyCache::toMetaObjectBuilder().
QMetaMethodBuilder QMetaObjectBuilder::addSlot | ( | const QByteArray & | signature | ) |
Adds a new public slot to this class with the specified signature.
Returns an object that can be used to adjust the other attributes of the slot. The signature will be normalized before it is added to the class.
Definition at line 451 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::methods, QMetaMethodBuilder, and QMetaMethod::Slot.
Referenced by addMethod(), and QQmlPropertyCache::toMetaObjectBuilder().
int QMetaObjectBuilder::classInfoCount | ( | ) | const |
Returns the number of items of class information in this class, exclusing the number of items of class information in the base class.
Definition at line 359 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::classInfoNames, and QList< T >::size().
QByteArray QMetaObjectBuilder::classInfoName | ( | int | index | ) | const |
Returns the name of the item of class information at index in this class.
Definition at line 804 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::classInfoNames.
QByteArray QMetaObjectBuilder::classInfoValue | ( | int | index | ) | const |
Returns the value of the item of class information at index in this class.
Definition at line 819 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::classInfoValues.
QByteArray QMetaObjectBuilder::className | ( | ) | const |
Returns the name of the class being constructed by this meta object builder.
The default value is an empty QByteArray.
Definition at line 244 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::className.
QMetaMethodBuilder QMetaObjectBuilder::constructor | ( | int | index | ) | const |
Returns the constructor at index in this class.
Definition at line 744 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::constructors, and QMetaMethodBuilder.
Referenced by indexOfConstructor().
int QMetaObjectBuilder::constructorCount | ( | ) | const |
Returns the number of constructors in this class.
Definition at line 324 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::constructors.
QMetaEnumBuilder QMetaObjectBuilder::enumerator | ( | int | index | ) | const |
Returns the enumerator at index in this class.
Definition at line 771 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::enumerators, and QMetaEnumBuilder.
Referenced by indexOfEnumerator().
int QMetaObjectBuilder::enumeratorCount | ( | ) | const |
Returns the number of enumerators in this class, excluding the number of enumerators in the base class.
Definition at line 347 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::enumerators.
MetaObjectFlags QMetaObjectBuilder::flags | ( | ) | const |
Returns the flags of the class being constructed by this meta object builder.
Definition at line 291 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::flags.
Referenced by setFlags().
int QMetaObjectBuilder::indexOfClassInfo | ( | const QByteArray & | name | ) |
Finds an item of class information with the specified name and returns its index; otherwise returns -1.
Definition at line 1021 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::classInfoNames, and QList< T >::size().
int QMetaObjectBuilder::indexOfConstructor | ( | const QByteArray & | signature | ) |
Finds a constructor with the specified signature and returns its index; otherwise returns -1.
The signature will be normalized by this method.
Definition at line 974 of file qmetaobjectbuilder.cpp.
References constructor(), QMetaObjectBuilderPrivate::constructors, QMetaObject::normalizedSignature(), and QMetaMethodBuilder::signature().
int QMetaObjectBuilder::indexOfEnumerator | ( | const QByteArray & | name | ) |
Finds an enumerator with the specified name and returns its index; otherwise returns -1.
Definition at line 1005 of file qmetaobjectbuilder.cpp.
References enumerator(), QMetaObjectBuilderPrivate::enumerators, and QMetaEnumBuilder::name().
int QMetaObjectBuilder::indexOfMethod | ( | const QByteArray & | signature | ) |
Finds a method with the specified signature and returns its index; otherwise returns -1.
The signature will be normalized by this method.
Definition at line 926 of file qmetaobjectbuilder.cpp.
References method, QMetaObjectBuilderPrivate::methods, and QMetaObject::normalizedSignature().
Referenced by addProperty().
int QMetaObjectBuilder::indexOfProperty | ( | const QByteArray & | name | ) |
Finds a property with the specified name and returns its index; otherwise returns -1.
Definition at line 990 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::properties, and property.
int QMetaObjectBuilder::indexOfSignal | ( | const QByteArray & | signature | ) |
Finds a signal with the specified signature and returns its index; otherwise returns -1.
The signature will be normalized by this method.
Definition at line 942 of file qmetaobjectbuilder.cpp.
References method, QMetaObjectBuilderPrivate::methods, QMetaObject::normalizedSignature(), and QMetaMethod::Signal.
int QMetaObjectBuilder::indexOfSlot | ( | const QByteArray & | signature | ) |
Finds a slot with the specified signature and returns its index; otherwise returns -1.
The signature will be normalized by this method.
Definition at line 958 of file qmetaobjectbuilder.cpp.
References method, QMetaObjectBuilderPrivate::methods, QMetaObject::normalizedSignature(), and QMetaMethod::Slot.
QMetaMethodBuilder QMetaObjectBuilder::method | ( | int | index | ) | const |
Returns the method at index in this class.
Definition at line 731 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::methods, and QMetaMethodBuilder.
int QMetaObjectBuilder::methodCount | ( | ) | const |
Returns the number of methods in this class, excluding the number of methods in the base class.
These include signals and slots as well as normal member functions.
Definition at line 314 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::methods.
QMetaPropertyBuilder QMetaObjectBuilder::property | ( | int | index | ) | const |
Returns the property at index in this class.
Definition at line 757 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::properties, and QMetaPropertyBuilder.
Referenced by QQmlOpenMetaObject::name(), and QQmlOpenMetaObjectType::propertyName().
int QMetaObjectBuilder::propertyCount | ( | ) | const |
Returns the number of properties in this class, excluding the number of properties in the base class.
Definition at line 335 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::properties.
Referenced by QQmlOpenMetaObjectType::createProperties(), and QQmlOpenMetaObjectType::createProperty().
const QMetaObject * QMetaObjectBuilder::relatedMetaObject | ( | int | index | ) | const |
Returns the related meta object at index in this class.
Related meta objects are used when resolving the enumerated type associated with a property, where the enumerated type is in a different class from the property.
Definition at line 789 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::relatedMetaObjects.
int QMetaObjectBuilder::relatedMetaObjectCount | ( | ) | const |
Returns the number of related meta objects that are associated with this class.
Related meta objects are used when resolving the enumerated type associated with a property, where the enumerated type is in a different class from the property.
Definition at line 375 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::relatedMetaObjects, and QList< T >::size().
void QMetaObjectBuilder::removeClassInfo | ( | int | index | ) |
Removes the item of class information at index from this class.
The indices of all following items will be adjusted downwards by 1.
Definition at line 894 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::classInfoNames, QMetaObjectBuilderPrivate::classInfoValues, and QList< T >::removeAt().
void QMetaObjectBuilder::removeConstructor | ( | int | index | ) |
Removes the constructor at index from this class.
The indices of all following constructors will be adjusted downwards by 1.
Definition at line 856 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::constructors.
void QMetaObjectBuilder::removeEnumerator | ( | int | index | ) |
Removes the enumerator at index from this class.
The indices of all following enumerators will be adjusted downwards by 1.
Definition at line 881 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::enumerators.
void QMetaObjectBuilder::removeMethod | ( | int | index | ) |
Removes the method at index from this class.
The indices of all following methods will be adjusted downwards by 1. If the method is registered as a notify signal on a property, then the notify signal will be removed from the property.
Definition at line 835 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::methods, QMetaObjectBuilderPrivate::properties, and property.
void QMetaObjectBuilder::removeProperty | ( | int | index | ) |
Removes the property at index from this class.
The indices of all following properties will be adjusted downwards by 1.
Definition at line 868 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::properties.
void QMetaObjectBuilder::removeRelatedMetaObject | ( | int | index | ) |
Removes the related meta object at index from this class.
The indices of all following related meta objects will be adjusted downwards by 1.
Related meta objects are used when resolving the enumerated type associated with a property, where the enumerated type is in a different class from the property.
Definition at line 914 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::relatedMetaObjects, and QList< T >::removeAt().
void QMetaObjectBuilder::setClassName | ( | const QByteArray & | name | ) |
Sets the name of the class being constructed by this meta object builder.
Definition at line 255 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::className.
Referenced by QQmlMetaType::clone(), QQmlOpenMetaObjectTypePrivate::init(), QQmlDelegateModelItemMetaType::initializeMetaObject(), QQmlAdaptorModelEngineData::setModelDataType(), and QQmlPropertyCache::toMetaObjectBuilder().
void QMetaObjectBuilder::setFlags | ( | MetaObjectFlags | flags | ) |
Sets the flags of the class being constructed by this meta object builder.
Definition at line 302 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::flags, and flags().
Referenced by VDMObjectDelegateDataType::VDMObjectDelegateDataType(), QQmlOpenMetaObjectTypePrivate::init(), QQmlDelegateModelItemMetaType::initializeMetaObject(), and QQmlAdaptorModelEngineData::setModelDataType().
void QMetaObjectBuilder::setStaticMetacallFunction | ( | QMetaObjectBuilder::StaticMetacallFunction | value | ) |
Sets the static metacall function to use to construct objects of this class to value.
The default value is null.
Definition at line 1495 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::staticMetacallFunction.
Referenced by addMetaObject().
void QMetaObjectBuilder::setSuperClass | ( | const QMetaObject * | meta | ) |
Sets the superclass meta object of the class being constructed by this meta object builder to meta.
The meta parameter must not be null.
Definition at line 279 of file qmetaobjectbuilder.cpp.
References Q_ASSERT, and QMetaObjectBuilderPrivate::superClass.
Referenced by QQmlPropertyCache::createMetaObject(), QQmlOpenMetaObjectTypePrivate::init(), QQmlDelegateModelItemMetaType::initializeMetaObject(), and QQmlAdaptorModelEngineData::setModelDataType().
QMetaObjectBuilder::StaticMetacallFunction QMetaObjectBuilder::staticMetacallFunction | ( | ) | const |
Returns the static metacall function to use to construct objects of this class.
The default value is null.
Definition at line 1484 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::staticMetacallFunction.
const QMetaObject * QMetaObjectBuilder::superClass | ( | ) | const |
Returns the superclass meta object of the class being constructed by this meta object builder.
The default value is the meta object for QObject.
Definition at line 267 of file qmetaobjectbuilder.cpp.
References QMetaObjectBuilderPrivate::superClass.
QMetaObject * QMetaObjectBuilder::toMetaObject | ( | ) | const |
Converts this meta object builder into a concrete QMetaObject.
The return value should be deallocated using free() once it is no longer needed.
The returned meta object is a snapshot of the state of the QMetaObjectBuilder. Any further modifications to the QMetaObjectBuilder will not be reflected in previous meta objects returned by this method.
Definition at line 1461 of file qmetaobjectbuilder.cpp.
Referenced by VDMListDelegateDataType::VDMListDelegateDataType(), QQmlPropertyCache::createMetaObject(), QQmlOpenMetaObjectType::createProperties(), VDMListDelegateDataType::createProperty(), QQmlDMObjectDataMetaObject::createProperty(), QQmlOpenMetaObjectType::createProperty(), QQmlTypePrivate::init(), QQmlOpenMetaObjectTypePrivate::init(), QQmlDelegateModelItemMetaType::initializeMetaObject(), VDMAbstractItemModelDataType::initializeMetaType(), VDMObjectDelegateDataType::initializeMetaType(), QQmlMetaType::proxyData(), and QQmlValueType::toDynamicMetaObject().
|
friend |
Definition at line 142 of file qmetaobjectbuilder_p.h.
Referenced by addEnumerator(), and enumerator().
|
friend |
Definition at line 140 of file qmetaobjectbuilder_p.h.
Referenced by addConstructor(), addMethod(), addMethod(), addSignal(), addSlot(), constructor(), and method().
|
friend |
Definition at line 141 of file qmetaobjectbuilder_p.h.
Referenced by addProperty(), and property().