Qt 4.8
Public Functions | Public Variables | Static Public Variables | List of all members
QDeclarativeTypePrivate Class Reference

Public Functions

void init () const
 
 QDeclarativeTypePrivate ()
 

Public Variables

int m_allocationSize
 
QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc
 
int m_attachedPropertiesId
 
const QMetaObjectm_attachedPropertiesType
 
const QMetaObjectm_baseMetaObject
 
bool m_containsRevisionedAttributes
 
QDeclarativeCustomParserm_customParser
 
QObject *(* m_extFunc )(QObject *)
 
const QMetaObjectm_extMetaObject
 
bool m_haveSuperType: 1
 
const char * m_iid
 
int m_index
 
bool m_isInterface: 1
 
volatile bool m_isSetup:1
 
int m_listId
 
QList< QDeclarativeProxyMetaObject::ProxyDatam_metaObjects
 
QByteArray m_module
 
QByteArray m_name
 
void(* m_newFunc )(void *)
 
QString m_noCreationReason
 
int m_parserStatusCast
 
int m_propertyValueInterceptorCast
 
int m_propertyValueSourceCast
 
int m_revision
 
QDeclarativeTypem_superType
 
int m_typeId
 
int m_version_maj
 
int m_version_min
 

Static Public Variables

static QHash< const QMetaObject *, int > m_attachedPropertyIds
 

Detailed Description

Definition at line 141 of file qdeclarativemetatype.cpp.

Constructors and Destructors

◆ QDeclarativeTypePrivate()

QDeclarativeTypePrivate::QDeclarativeTypePrivate ( )

Definition at line 183 of file qdeclarativemetatype.cpp.

188  m_isSetup(false), m_haveSuperType(false)
189 {
190 }
const QMetaObject * m_baseMetaObject
QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc
const QMetaObject * m_attachedPropertiesType
QDeclarativeCustomParser * m_customParser
QObject *(* m_extFunc)(QObject *)
const QMetaObject * m_extMetaObject

Functions

◆ init()

void QDeclarativeTypePrivate::init ( ) const

Definition at line 362 of file qdeclarativemetatype.cpp.

Referenced by QDeclarativeType::containsRevisionedAttributes(), QDeclarativeType::create(), QDeclarativeType::isExtendedType(), and QDeclarativeType::metaObject().

363 {
364  if (m_isSetup) return;
365 
366  QWriteLocker lock(metaTypeDataLock());
367  if (m_isSetup)
368  return;
369 
370  // Setup extended meta object
371  // XXX - very inefficient
372  const QMetaObject *mo = m_baseMetaObject;
373  if (m_extFunc) {
374  QMetaObject *mmo = new QMetaObject;
375  *mmo = *m_extMetaObject;
376  mmo->d.superdata = mo;
378  m_metaObjects << data;
379  }
380 
381  mo = mo->d.superdata;
382  while(mo) {
383  QDeclarativeType *t = metaTypeData()->metaObjectToType.value(mo);
384  if (t) {
385  if (t->d->m_extFunc) {
386  QMetaObjectBuilder builder;
388  QMetaObject *mmo = builder.toMetaObject();
390  if (!m_metaObjects.isEmpty())
393  m_metaObjects << data;
394  }
395  }
396  mo = mo->d.superdata;
397  }
398 
399  for (int ii = 0; ii < m_metaObjects.count(); ++ii) {
400  m_metaObjects[ii].propertyOffset =
402  m_metaObjects[ii].methodOffset =
404  }
405 
406  // Check for revisioned details
407  {
408  const QMetaObject *mo = 0;
409  if (m_metaObjects.isEmpty())
410  mo = m_baseMetaObject;
411  else
413 
414  for (int ii = 0; !m_containsRevisionedAttributes && ii < mo->propertyCount(); ++ii) {
415  if (mo->property(ii).revision() != 0)
417  }
418 
419  for (int ii = 0; !m_containsRevisionedAttributes && ii < mo->methodCount(); ++ii) {
420  if (mo->method(ii).revision() != 0)
422  }
423  }
424 
425  m_isSetup = true;
426  lock.unlock();
427 }
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
const QMetaObject * m_baseMetaObject
void unlock()
Unlocks the lock.
QDeclarativeTypePrivate * d
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
int propertyCount() const
Returns the number of properties in this class, including the number of properties provided by each b...
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
int methodOffset() const
Returns the method offset for this class; i.e.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static const char * data(const QByteArray &arr)
QObject *(* m_extFunc)(QObject *)
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
const QMetaObject * m_extMetaObject
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
const QMetaObject * superdata
Definition: qobjectdefs.h:469
QList< QDeclarativeProxyMetaObject::ProxyData > m_metaObjects
static QReadWriteLock lock
Definition: proxyconf.cpp:399
struct QMetaObject::@38 d
int revision() const
Returns the method revision if one was specified by Q_REVISION, otherwise returns 0...
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 revision() const
Returns the property revision if one was specified by REVISION, otherwise returns 0...
QMetaObject * toMetaObject() const
Converts this meta object builder into a concrete QMetaObject.
int methodCount() const
Returns the number of methods known to the meta-object system in this class, including the number of ...
QMetaProperty property(int index) const
Returns the meta-data for the property with the given index.
static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo, const QMetaObject *ignoreStart, const QMetaObject *ignoreEnd)

Properties

◆ m_allocationSize

int QDeclarativeTypePrivate::m_allocationSize

◆ m_attachedPropertiesFunc

QDeclarativeAttachedPropertiesFunc QDeclarativeTypePrivate::m_attachedPropertiesFunc

◆ m_attachedPropertiesId

int QDeclarativeTypePrivate::m_attachedPropertiesId

◆ m_attachedPropertiesType

const QMetaObject* QDeclarativeTypePrivate::m_attachedPropertiesType

◆ m_attachedPropertyIds

QHash< const QMetaObject *, int > QDeclarativeTypePrivate::m_attachedPropertyIds
static

Definition at line 178 of file qdeclarativemetatype.cpp.

Referenced by QDeclarativeType::QDeclarativeType().

◆ m_baseMetaObject

const QMetaObject* QDeclarativeTypePrivate::m_baseMetaObject

◆ m_containsRevisionedAttributes

bool QDeclarativeTypePrivate::m_containsRevisionedAttributes
mutable

◆ m_customParser

QDeclarativeCustomParser* QDeclarativeTypePrivate::m_customParser

◆ m_extFunc

QObject*(* QDeclarativeTypePrivate::m_extFunc) (QObject *)

Definition at line 170 of file qdeclarativemetatype.cpp.

Referenced by init(), and QDeclarativeType::QDeclarativeType().

◆ m_extMetaObject

const QMetaObject* QDeclarativeTypePrivate::m_extMetaObject

Definition at line 171 of file qdeclarativemetatype.cpp.

Referenced by init(), and QDeclarativeType::QDeclarativeType().

◆ m_haveSuperType

bool QDeclarativeTypePrivate::m_haveSuperType
mutable

Definition at line 175 of file qdeclarativemetatype.cpp.

Referenced by QDeclarativeType::superType().

◆ m_iid

const char* QDeclarativeTypePrivate::m_iid

◆ m_index

int QDeclarativeTypePrivate::m_index

◆ m_isInterface

bool QDeclarativeTypePrivate::m_isInterface

◆ m_isSetup

volatile bool QDeclarativeTypePrivate::m_isSetup
mutable

Definition at line 174 of file qdeclarativemetatype.cpp.

Referenced by QDeclarativeType::QDeclarativeType().

◆ m_listId

int QDeclarativeTypePrivate::m_listId

◆ m_metaObjects

QList<QDeclarativeProxyMetaObject::ProxyData> QDeclarativeTypePrivate::m_metaObjects
mutable

◆ m_module

QByteArray QDeclarativeTypePrivate::m_module

◆ m_name

QByteArray QDeclarativeTypePrivate::m_name

◆ m_newFunc

void(* QDeclarativeTypePrivate::m_newFunc) (void *)

◆ m_noCreationReason

QString QDeclarativeTypePrivate::m_noCreationReason

◆ m_parserStatusCast

int QDeclarativeTypePrivate::m_parserStatusCast

◆ m_propertyValueInterceptorCast

int QDeclarativeTypePrivate::m_propertyValueInterceptorCast

◆ m_propertyValueSourceCast

int QDeclarativeTypePrivate::m_propertyValueSourceCast

◆ m_revision

int QDeclarativeTypePrivate::m_revision

◆ m_superType

QDeclarativeType* QDeclarativeTypePrivate::m_superType
mutable

Definition at line 157 of file qdeclarativemetatype.cpp.

Referenced by QDeclarativeType::superType().

◆ m_typeId

int QDeclarativeTypePrivate::m_typeId

◆ m_version_maj

int QDeclarativeTypePrivate::m_version_maj

◆ m_version_min

int QDeclarativeTypePrivate::m_version_min

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