![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\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.
typedef void(* QMetaObjectBuilder::StaticMetacallFunction) (QObject *, QMetaObject::Call, int, void **) |
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 203 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 219 of file qmetaobjectbuilder.cpp.
|
virtual |
Destroys this meta object builder.
Definition at line 229 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 616 of file qmetaobjectbuilder.cpp.
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 480 of file qmetaobjectbuilder.cpp.
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 499 of file qmetaobjectbuilder.cpp.
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 578 of file qmetaobjectbuilder.cpp.
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 594 of file qmetaobjectbuilder.cpp.
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 650 of file qmetaobjectbuilder.cpp.
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 384 of file qmetaobjectbuilder.cpp.
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 400 of file qmetaobjectbuilder.cpp.
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 419 of file qmetaobjectbuilder.cpp.
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 520 of file qmetaobjectbuilder.cpp.
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 529 of file qmetaobjectbuilder.cpp.
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 544 of file qmetaobjectbuilder.cpp.
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 635 of file qmetaobjectbuilder.cpp.
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 463 of file qmetaobjectbuilder.cpp.
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 448 of file qmetaobjectbuilder.cpp.
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 355 of file qmetaobjectbuilder.cpp.
QByteArray QMetaObjectBuilder::classInfoName | ( | int | index | ) | const |
Returns the name of the item of class information at index in this class.
Definition at line 803 of file qmetaobjectbuilder.cpp.
QByteArray QMetaObjectBuilder::classInfoValue | ( | int | index | ) | const |
Returns the value of the item of class information at index in this class.
Definition at line 818 of file qmetaobjectbuilder.cpp.
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 240 of file qmetaobjectbuilder.cpp.
QMetaMethodBuilder QMetaObjectBuilder::constructor | ( | int | index | ) | const |
Returns the constructor at index in this class.
Definition at line 743 of file qmetaobjectbuilder.cpp.
int QMetaObjectBuilder::constructorCount | ( | ) | const |
Returns the number of constructors in this class.
Definition at line 320 of file qmetaobjectbuilder.cpp.
QMetaEnumBuilder QMetaObjectBuilder::enumerator | ( | int | index | ) | const |
Returns the enumerator at index in this class.
Definition at line 770 of file qmetaobjectbuilder.cpp.
int QMetaObjectBuilder::enumeratorCount | ( | ) | const |
Returns the number of enumerators in this class, excluding the number of enumerators in the base class.
Definition at line 343 of file qmetaobjectbuilder.cpp.
MetaObjectFlags QMetaObjectBuilder::flags | ( | ) | const |
Returns the flags of the class being constructed by this meta object builder.
Definition at line 287 of file qmetaobjectbuilder.cpp.
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 1020 of file qmetaobjectbuilder.cpp.
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 973 of file qmetaobjectbuilder.cpp.
int QMetaObjectBuilder::indexOfEnumerator | ( | const QByteArray & | name | ) |
Finds an enumerator with the specified name and returns its index; otherwise returns -1.
Definition at line 1004 of file qmetaobjectbuilder.cpp.
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 925 of file qmetaobjectbuilder.cpp.
int QMetaObjectBuilder::indexOfProperty | ( | const QByteArray & | name | ) |
Finds a property with the specified name and returns its index; otherwise returns -1.
Definition at line 989 of file qmetaobjectbuilder.cpp.
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 941 of file qmetaobjectbuilder.cpp.
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 957 of file qmetaobjectbuilder.cpp.
QMetaMethodBuilder QMetaObjectBuilder::method | ( | int | index | ) | const |
Returns the method at index in this class.
Definition at line 730 of file qmetaobjectbuilder.cpp.
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 310 of file qmetaobjectbuilder.cpp.
QMetaPropertyBuilder QMetaObjectBuilder::property | ( | int | index | ) | const |
Returns the property at index in this class.
Definition at line 756 of file qmetaobjectbuilder.cpp.
int QMetaObjectBuilder::propertyCount | ( | ) | const |
Returns the number of properties in this class, excluding the number of properties in the base class.
Definition at line 331 of file qmetaobjectbuilder.cpp.
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 788 of file qmetaobjectbuilder.cpp.
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 371 of file qmetaobjectbuilder.cpp.
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 893 of file qmetaobjectbuilder.cpp.
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 855 of file qmetaobjectbuilder.cpp.
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 880 of file qmetaobjectbuilder.cpp.
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 834 of file qmetaobjectbuilder.cpp.
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 867 of file qmetaobjectbuilder.cpp.
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 913 of file qmetaobjectbuilder.cpp.
void QMetaObjectBuilder::setClassName | ( | const QByteArray & | name | ) |
Sets the name of the class being constructed by this meta object builder.
Definition at line 251 of file qmetaobjectbuilder.cpp.
void QMetaObjectBuilder::setFlags | ( | MetaObjectFlags | flags | ) |
Sets the flags of the class being constructed by this meta object builder.
Definition at line 298 of file qmetaobjectbuilder.cpp.
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 1511 of file qmetaobjectbuilder.cpp.
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 275 of file qmetaobjectbuilder.cpp.
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 1500 of file qmetaobjectbuilder.cpp.
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 263 of file qmetaobjectbuilder.cpp.
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 1478 of file qmetaobjectbuilder.cpp.
|
friend |
Definition at line 142 of file qmetaobjectbuilder_p.h.
|
friend |
Definition at line 140 of file qmetaobjectbuilder_p.h.
|
friend |
Definition at line 141 of file qmetaobjectbuilder_p.h.