Qt 4.8
Public Functions | Public Variables | List of all members
QDeclarativeCompiledData::TypeReference Struct Reference

#include <qdeclarativecompiler_p.h>

Public Functions

QObject * createInstance (QDeclarativeContextData *, const QBitField &, QList< QDeclarativeError > *) const
 
QDeclarativePropertyCache * createPropertyCache (QDeclarativeEngine *)
 Returns the property cache, creating one if it doesn't already exist. More...
 
const QMetaObject * metaObject () const
 
QDeclarativePropertyCache * propertyCache () const
 Returns the property cache, if one alread exists. More...
 
 TypeReference ()
 

Public Variables

QByteArray className
 
QDeclarativeCompiledData * component
 
QDeclarativeType * type
 
QDeclarativePropertyCache * typePropertyCache
 

Detailed Description

Definition at line 89 of file qdeclarativecompiler_p.h.

Constructors and Destructors

◆ TypeReference()

QDeclarativeCompiledData::TypeReference::TypeReference ( )
inline

Definition at line 91 of file qdeclarativecompiler_p.h.

Functions

◆ createInstance()

QObject * QDeclarativeCompiledData::TypeReference::createInstance ( QDeclarativeContextData *  ctxt,
const QBitField &  bindings,
QList< QDeclarativeError > *  errors 
) const

Definition at line 1055 of file qdeclarativevme.cpp.

Referenced by QDeclarativeVME::run().

1058 {
1059  if (type) {
1060  QObject *rv = 0;
1061  void *memory = 0;
1062 
1063  type->create(&rv, &memory, sizeof(QDeclarativeData));
1064  QDeclarativeData *ddata = new (memory) QDeclarativeData;
1065  ddata->ownMemory = false;
1066  QObjectPrivate::get(rv)->declarativeData = ddata;
1067 
1068  if (typePropertyCache && !ddata->propertyCache) {
1070  ddata->propertyCache->addref();
1071  }
1072 
1073  return rv;
1074  } else {
1076  return QDeclarativeComponentPrivate::begin(ctxt, 0, component, -1, -1, 0, errors, bindings);
1077  }
1078 }
QDeclarativePropertyCache * propertyCache
QDeclarativePropertyCache * typePropertyCache
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
QAbstractDeclarativeData * declarativeData
Definition: qobject_p.h:214
static QObject * begin(QDeclarativeContextData *parentContext, QDeclarativeContextData *componentCreationContext, QDeclarativeCompiledData *component, int start, int count, ConstructionState *state, QList< QDeclarativeError > *errors, const QBitField &bindings=QBitField())
QObject * create() const

◆ createPropertyCache()

QDeclarativePropertyCache * QDeclarativeCompiledData::TypeReference::createPropertyCache ( QDeclarativeEngine *  engine)

Returns the property cache, creating one if it doesn't already exist.

The cache is not referenced.

Definition at line 228 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::genObject().

229 {
230  if (typePropertyCache) {
231  return typePropertyCache;
232  } else if (type) {
235  return typePropertyCache;
236  } else {
238  }
239 }
QDeclarativePropertyCache * cache(QObject *obj)
Returns a QDeclarativePropertyCache for obj if one is available.
QDeclarativePropertyCache * typePropertyCache
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
QDeclarativePropertyCache * rootPropertyCache
const QMetaObject * metaObject() const

◆ metaObject()

const QMetaObject * QDeclarativeCompiledData::TypeReference::metaObject ( ) const

Definition at line 204 of file qdeclarativecompileddata.cpp.

Referenced by QDeclarativeCompiler::buildObject().

205 {
206  if (type) {
207  return type->metaObject();
208  } else {
210  return component->root;
211  }
212 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const QMetaObject * metaObject() const

◆ propertyCache()

QDeclarativePropertyCache * QDeclarativeCompiledData::TypeReference::propertyCache ( ) const

Returns the property cache, if one alread exists.

The cache is not referenced.

Definition at line 217 of file qdeclarativecompileddata.cpp.

218 {
219  if (type)
220  return typePropertyCache;
221  else
223 }
QDeclarativePropertyCache * typePropertyCache
QDeclarativePropertyCache * rootPropertyCache

Properties

◆ className

QByteArray QDeclarativeCompiledData::TypeReference::className

◆ component

QDeclarativeCompiledData* QDeclarativeCompiledData::TypeReference::component

◆ type

QDeclarativeType* QDeclarativeCompiledData::TypeReference::type

◆ typePropertyCache

QDeclarativePropertyCache* QDeclarativeCompiledData::TypeReference::typePropertyCache

Definition at line 96 of file qdeclarativecompiler_p.h.

Referenced by QDeclarativeCompiler::compile(), and QDeclarativeVME::run().


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