Qt 4.8
Classes | Public Functions | Protected Functions | Properties | List of all members
QDeclarativeProxyMetaObject Class Reference

#include <qdeclarativeproxymetaobject_p.h>

Inheritance diagram for QDeclarativeProxyMetaObject:
QAbstractDynamicMetaObject QMetaObject

Classes

struct  ProxyData
 

Public Functions

 QDeclarativeProxyMetaObject (QObject *, QList< ProxyData > *)
 
virtual ~QDeclarativeProxyMetaObject ()
 
- Public Functions inherited from QAbstractDynamicMetaObject
virtual int createProperty (const char *, const char *)
 
virtual ~QAbstractDynamicMetaObject ()
 
- Public Functions inherited from QMetaObject
QObjectcast (QObject *obj) const
 Returns obj if object obj inherits from this meta-object; otherwise returns 0. More...
 
const QObjectcast (const QObject *obj) const
 Returns obj if object obj inherits from this meta-object; otherwise returns 0. More...
 
QMetaClassInfo classInfo (int index) const
 Returns the meta-data for the item of class information with the given index. More...
 
int classInfoCount () const
 Returns the number of items of class information in this class. More...
 
int classInfoOffset () const
 Returns the class information offset for this class; i.e. More...
 
const char * className () const
 Returns the class name. More...
 
QMetaMethod constructor (int index) const
 Returns the meta-data for the constructor with the given index. More...
 
int constructorCount () const
 Returns the number of constructors in this class. More...
 
QMetaEnum enumerator (int index) const
 Returns the meta-data for the enumerator with the given index. More...
 
int enumeratorCount () const
 Returns the number of enumerators in this class. More...
 
int enumeratorOffset () const
 Returns the enumerator offset for this class; i.e. More...
 
int indexOfClassInfo (const char *name) const
 Finds class information item name and returns its index; otherwise returns -1. More...
 
int indexOfConstructor (const char *constructor) const
 Finds constructor and returns its index; otherwise returns -1. More...
 
int indexOfEnumerator (const char *name) const
 Finds enumerator name and returns its index; otherwise returns -1. More...
 
int indexOfMethod (const char *method) const
 Finds method and returns its index; otherwise returns -1. More...
 
int indexOfProperty (const char *name) const
 Finds property name and returns its index; otherwise returns -1. More...
 
int indexOfSignal (const char *signal) const
 Finds signal and returns its index; otherwise returns -1. More...
 
int indexOfSlot (const char *slot) const
 Finds slot and returns its index; otherwise returns -1. More...
 
QMetaMethod method (int index) const
 Returns the meta-data for the method with the given index. More...
 
int methodCount () const
 Returns the number of methods known to the meta-object system in this class, including the number of properties provided by each base class. More...
 
int methodOffset () const
 Returns the method offset for this class; i.e. More...
 
QObjectnewInstance (QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument()) const
 Constructs a new instance of this class. More...
 
QMetaProperty property (int index) const
 Returns the meta-data for the property with the given index. More...
 
int propertyCount () const
 Returns the number of properties in this class, including the number of properties provided by each base class. More...
 
int propertyOffset () const
 Returns the property offset for this class; i.e. More...
 
int static_metacall (Call, int, void **) const
 
const QMetaObjectsuperClass () const
 Returns the meta-object of the superclass, or 0 if there is no such object. More...
 
QString tr (const char *s, const char *c) const
 
QString tr (const char *s, const char *c, int n) const
 
QString trUtf8 (const char *s, const char *c) const
 
QString trUtf8 (const char *s, const char *c, int n) const
 
QMetaProperty userProperty () const
 Returns the property that has the USER flag set to true. More...
 

Protected Functions

virtual int metaCall (QMetaObject::Call _c, int _id, void **_a)
 

Properties

QList< ProxyData > * metaObjects
 
QObjectobject
 
QAbstractDynamicMetaObjectparent
 
QObject ** proxies
 

Additional Inherited Members

- Public Types inherited from QMetaObject
enum  Call {
  InvokeMetaMethod, ReadProperty, WriteProperty, ResetProperty,
  QueryPropertyDesignable, QueryPropertyScriptable, QueryPropertyStored, QueryPropertyEditable,
  QueryPropertyUser, CreateInstance
}
 
- Static Public Functions inherited from QMetaObject
static void activate (QObject *sender, int signal_index, void **argv)
 
static void activate (QObject *sender, int from_signal_index, int to_signal_index, void **argv)
 
static void activate (QObject *sender, const QMetaObject *, int local_signal_index, void **argv)
 
static void activate (QObject *sender, const QMetaObject *, int from_local_signal_index, int to_local_signal_index, void **argv)
 
static void addGuard (QObject **ptr)
 
static void changeGuard (QObject **ptr, QObject *o)
 
static bool checkConnectArgs (const char *signal, const char *method)
 Returns true if the signal and method arguments are compatible; otherwise returns false. More...
 
static bool connect (const QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=0)
 
static void connectSlotsByName (QObject *o)
 Searches recursively for all child objects of the given object, and connects matching signals from them to slots of object that follow the following form: More...
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
 
static bool disconnectOne (const QObject *sender, int signal_index, const QObject *receiver, int method_index)
 
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 Invokes the member (a signal or a slot name) on the object obj. More...
 
static bool invokeMethod (QObject *obj, const char *member, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static bool invokeMethod (QObject *obj, const char *member, Qt::ConnectionType type, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static bool invokeMethod (QObject *obj, const char *member, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
 
static int metacall (QObject *, Call, int, void **)
 
static QByteArray normalizedSignature (const char *method)
 Normalizes the signature of the given method. More...
 
static QByteArray normalizedType (const char *type)
 Normalizes a type. More...
 
static void removeGuard (QObject **ptr)
 
- Public Variables inherited from QMetaObject
struct {
   const uint *   data
 
   const void *   extradata
 
   const char *   stringdata
 
   const QMetaObject *   superdata
 
d
 

Detailed Description

Definition at line 70 of file qdeclarativeproxymetaobject_p.h.

Constructors and Destructors

◆ QDeclarativeProxyMetaObject()

QDeclarativeProxyMetaObject::QDeclarativeProxyMetaObject ( QObject obj,
QList< ProxyData > *  mList 
)

Definition at line 47 of file qdeclarativeproxymetaobject.cpp.

48 : metaObjects(mList), proxies(0), parent(0), object(obj)
49 {
50  *static_cast<QMetaObject *>(this) = *metaObjects->first().metaObject;
51 
53  if (op->metaObject)
54  parent = static_cast<QAbstractDynamicMetaObject*>(op->metaObject);
55 
56  op->metaObject = this;
57 }
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
QAbstractDynamicMetaObject * parent
QMetaObject * metaObject
Definition: qobject.h:107

◆ ~QDeclarativeProxyMetaObject()

QDeclarativeProxyMetaObject::~QDeclarativeProxyMetaObject ( )
virtual

Definition at line 59 of file qdeclarativeproxymetaobject.cpp.

60 {
61  if (parent)
62  delete parent;
63  parent = 0;
64 
65  if (proxies)
66  delete [] proxies;
67  proxies = 0;
68 }
QAbstractDynamicMetaObject * parent

Functions

◆ metaCall()

int QDeclarativeProxyMetaObject::metaCall ( QMetaObject::Call  _c,
int  _id,
void **  _a 
)
protectedvirtual

Reimplemented from QAbstractDynamicMetaObject.

Definition at line 70 of file qdeclarativeproxymetaobject.cpp.

71 {
72  if ((c == QMetaObject::ReadProperty ||
74  id >= metaObjects->last().propertyOffset) {
75 
76  for (int ii = 0; ii < metaObjects->count(); ++ii) {
77  const ProxyData &data = metaObjects->at(ii);
78  if (id >= data.propertyOffset) {
79  if (!proxies) {
80  proxies = new QObject*[metaObjects->count()];
81  ::memset(proxies, 0,
82  sizeof(QObject *) * metaObjects->count());
83  }
84 
85  if (!proxies[ii]) {
86  QObject *proxy = data.createFunc(object);
87  const QMetaObject *metaObject = proxy->metaObject();
88  proxies[ii] = proxy;
89 
90  int localOffset = data.metaObject->methodOffset();
91  int methodOffset = metaObject->methodOffset();
92  int methods = metaObject->methodCount() - methodOffset;
93 
94  // ### - Can this be done more optimally?
95  for (int jj = 0; jj < methods; ++jj) {
97  metaObject->method(jj + methodOffset);
98  if (method.methodType() == QMetaMethod::Signal)
99  QDeclarativePropertyPrivate::connect(proxy, methodOffset + jj, object, localOffset + jj);
100  }
101  }
102 
103  int proxyOffset = proxies[ii]->metaObject()->propertyOffset();
104  int proxyId = id - data.propertyOffset + proxyOffset;
105 
106  return proxies[ii]->qt_metacall(c, proxyId, a);
107  }
108  }
109  } else if (c == QMetaObject::InvokeMetaMethod &&
110  id >= metaObjects->last().methodOffset) {
111  QMetaMethod m = object->metaObject()->method(id);
112  if (m.methodType() == QMetaMethod::Signal) {
113  QMetaObject::activate(object, id, a);
114  return -1;
115  }
116  }
117 
118  if (parent)
119  return parent->metaCall(c, id, a);
120  else
121  return object->qt_metacall(c, id, a);
122 }
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
unsigned char c[8]
Definition: qnumeric_p.h:62
static bool connect(QObject *sender, int signal_index, const QObject *receiver, int method_index, int type=0, int *types=0)
Connect sender signal_index to receiver method_index with the specified type and types.
long ASN1_INTEGER_get ASN1_INTEGER * a
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
virtual int metaCall(QMetaObject::Call, int _id, void **)
Definition: qobject_p.h:336
int methodOffset() const
Returns the method offset for this class; i.e.
const uint * data
Definition: qobjectdefs.h:471
MethodType methodType() const
Returns the type of this method (signal, slot, or method).
static void activate(QObject *sender, int signal_index, void **argv)
Definition: qobject.cpp:3690
QAbstractDynamicMetaObject * parent
QMetaMethod method(int index) const
Returns the meta-data for the method with the given index.
int propertyOffset() const
Returns the property offset for this class; i.e.
int methodCount() const
Returns the number of methods known to the meta-object system in this class, including the number of ...
The QMetaMethod class provides meta-data about a member function.
Definition: qmetaobject.h:56
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.

Properties

◆ metaObjects

QList<ProxyData>* QDeclarativeProxyMetaObject::metaObjects
private

Definition at line 88 of file qdeclarativeproxymetaobject_p.h.

Referenced by metaCall(), and QDeclarativeProxyMetaObject().

◆ object

QObject* QDeclarativeProxyMetaObject::object
private

Definition at line 92 of file qdeclarativeproxymetaobject_p.h.

◆ parent

QAbstractDynamicMetaObject* QDeclarativeProxyMetaObject::parent
private

◆ proxies

QObject** QDeclarativeProxyMetaObject::proxies
private

Definition at line 89 of file qdeclarativeproxymetaobject_p.h.

Referenced by metaCall(), and ~QDeclarativeProxyMetaObject().


The documentation for this class was generated from the following files: