NuriaProject Framework
0.1
The NuriaProject Framework
|
QtMetaObjectWrapper lets you use a QMetaObject as Nuria::MetaObject. More...
#include <qtmetaobjectwrapper.hpp>
Public Member Functions | |
QtMetaObjectWrapper (const QMetaObject *metaObject) | |
~QtMetaObjectWrapper () override | |
![]() | |
RuntimeMetaObject (const QByteArray &name) | |
~RuntimeMetaObject () | |
void | addEnum (const QByteArray &name, const AnnotationMap &annotations, const QMap< QByteArray, int > &keyValueMap) |
void | addField (const QByteArray &name, const QByteArray &valueType, const AnnotationMap &annotations, FieldGetter getter, FieldSetter setter) |
void | addField (const QByteArray &name, const QByteArray &valueType, const AnnotationMap &annotations, FieldGetter getter) |
void | addMethod (MetaMethod::Type type, const QByteArray &name, const QByteArray &returnType, const QVector< QByteArray > &argumentNames, const QVector< QByteArray > &argumentTypes, const AnnotationMap &annotations, InvokeCreator invokeCreator) |
void | finalize () |
void | setAnnotations (const AnnotationMap &annotations) |
void | setBaseClasses (const QVector< QByteArray > &bases) |
void | setInstanceDeleter (InstanceDeleter deleter) |
void | setQtMetaTypeId (int valueTypeId) |
void | setQtMetaTypePointerId (int pointerTypeId) |
![]() | |
MetaObject () | |
virtual | ~MetaObject () |
MetaAnnotation | annotation (int idx) const |
int | annotationCount () |
int | annotationLowerBound (const QByteArray &name) const |
int | annotationUpperBound (const QByteArray &name) const |
QByteArray | className () |
void | destroyInstance (void *instance) |
MetaEnum | enumAt (int idx) |
MetaEnum | enumByName (const QByteArray &name) |
int | enumCount () |
MetaField | field (int idx) |
MetaField | fieldByName (const QByteArray &name) |
int | fieldCount () |
int | metaTypeId () |
MetaMethod | method (int idx) |
MetaMethod | method (const QVector< QByteArray > &prototype) |
int | methodCount () |
int | methodLowerBound (const QByteArray &name) |
int | methodUpperBound (const QByteArray &name) |
QVector< QByteArray > | parents () |
int | pointerMetaTypeId () |
Additional Inherited Members | |
![]() | |
typedef QMultiMap< QByteArray, QVariant > | AnnotationMap |
typedef std::function< QVariant(void *) > | FieldGetter |
typedef std::function< bool(void *, const QVariant &) > | FieldSetter |
typedef std::function< void(void *) > | InstanceDeleter |
enum | InvokeAction { InvokeAction::Invoke, InvokeAction::UnsafeInvoke, InvokeAction::ArgumentTest } |
typedef std::function< Callback(void *, InvokeAction) > | InvokeCreator |
![]() | |
enum | GateMethod { ClassName = 0, MetaTypeId = 1, PointerMetaTypeId = 2, BaseClasses = 3, AnnotationCount = 4, MethodCount = 5, FieldCount = 6, EnumCount = 7, AnnotationName = 10, AnnotationValue = 11, MethodName = 20, MethodType = 21, MethodReturnType = 22, MethodArgumentNames = 23, MethodArgumentTypes = 24, MethodCallback = 25, MethodUnsafeCallback = 26, MethodArgumentTest = 27, FieldName = 30, FieldType = 31, FieldRead = 32, FieldWrite = 33, FieldAccess = 34, EnumName = 40, EnumElementCount = 41, EnumElementKey = 42, EnumElementValue = 43, DestroyInstance = 50 } |
![]() | |
static MetaObjectMap | allTypes () |
static MetaObject * | byName (const QByteArray &type) |
static MetaObject * | byTypeId (int typeId) |
template<typename T > | |
static MetaObject * | of () |
static void | registerMetaObject (MetaObject *object) |
Registers object to the global meta system. More... | |
static MetaObjectMap | typesInheriting (const QByteArray &typeName) |
static MetaObjectMap | typesWithAnnotation (const QByteArray &name) |
![]() | |
void | gateCall (GateMethod method, int category, int index, int nth, void *result, void *additional) override |
QtMetaObjectWrapper lets you use a QMetaObject as Nuria::MetaObject.
This class is meant to be used for classes you don't have writing access to (In which case you could simply tag it with NURIA_INTROSPECT) or if you don't want to use Tria. You can also use this class to ease transition to Tria. Note that when using Tria, you won't need to manually export types anymore like you need to when using pure Qt.
-introspect-all
or -introspect-inheriting!
The wrapper will expose all known public methods (Q_INVOKABLE methods and slots), enums and Qt properties. Information of the base class is not included. Constructors are not exposed.
Annotations stored as Q_CLASSINFO()
will be stored as class annotations with the value as QString. To expose methods which are not public slots prefix them with Q_INVOKABLE
- This also applies to constructors.
Nuria::QtMetaObjectWrapper::QtMetaObjectWrapper | ( | const QMetaObject * | metaObject | ) |
Creates a instance which is populated by metaObject.
There is no further action required to use the MetaObject.
|
override |
Destructor.