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

#include <qdeclarativedata_p.h>

Inheritance diagram for QDeclarativeData:
QAbstractDeclarativeData

Public Functions

void addBoundSignal (QDeclarativeAbstractBoundSignal *signal)
 
QHash< int, QObject * > * attachedProperties () const
 
void clearBindingBit (int)
 
void destroyed (QObject *)
 
void disconnectNotifiers ()
 
bool hasBindingBit (int) const
 
bool hasExtendedData () const
 
void objectNameChanged (QObject *)
 
QDeclarativeNotifierobjectNameNotifier () const
 
void parentChanged (QObject *, QObject *)
 
 QDeclarativeData ()
 
void removeBoundSignal (QDeclarativeAbstractBoundSignal *signal)
 
void setBindingBit (QObject *obj, int)
 
void setImplicitDestructible ()
 

Static Public Functions

static void destroyed (QAbstractDeclarativeData *, QObject *)
 
static QDeclarativeDataget (const QObject *object, bool create=false)
 
static void init ()
 
static void objectNameChanged (QAbstractDeclarativeData *, QObject *)
 
static void parentChanged (QAbstractDeclarativeData *, QObject *, QObject *)
 

Public Variables

quint32bindingBits
 
int bindingBitsSize
 
QDeclarativeAbstractBindingbindings
 
ushort columnNumber
 
QDeclarativeContextDatacontext
 
QDeclarativeCompiledDatadeferredComponent
 
unsigned int deferredIdx
 
quint32 dummy:28
 
quint32 explicitIndestructibleSet:1
 
QDeclarativeGuardImplguards
 
quint32 indestructible:1
 
ushort lineNumber
 
QDeclarativeDatanextContextObject
 
quint32 objectDataRefCount
 
QDeclarativeContextDataouterContext
 
quint32 ownContext:1
 
quint32 ownMemory:1
 
QDeclarativeData ** prevContextObject
 
QDeclarativePropertyCachepropertyCache
 
QScriptValuescriptValue
 

Properties

QDeclarativeDataExtendedextendedData
 

Additional Inherited Members

- Static Public Variables inherited from QAbstractDeclarativeData
static void(* destroyed )(QAbstractDeclarativeData *, QObject *)
 
static void(* objectNameChanged )(QAbstractDeclarativeData *, QObject *)
 
static void(* parentChanged )(QAbstractDeclarativeData *, QObject *, QObject *)
 

Detailed Description

Definition at line 74 of file qdeclarativedata_p.h.

Constructors and Destructors

◆ QDeclarativeData()

QDeclarativeData::QDeclarativeData ( )
inline

Definition at line 77 of file qdeclarativedata_p.h.

78  : ownMemory(true), ownContext(false), indestructible(true), explicitIndestructibleSet(false),
82  init();
83  }
QDeclarativeContextData * outerContext
QDeclarativeContextData * context
QDeclarativePropertyCache * propertyCache
QDeclarativeAbstractBinding * bindings
static void init()
unsigned int deferredIdx
QDeclarativeDataExtended * extendedData
QDeclarativeCompiledData * deferredComponent
quint32 explicitIndestructibleSet
QDeclarativeData ** prevContextObject
QDeclarativeData * nextContextObject
QDeclarativeGuardImpl * guards
QScriptValue * scriptValue

Functions

◆ addBoundSignal()

void QDeclarativeData::addBoundSignal ( QDeclarativeAbstractBoundSignal signal)

Definition at line 1159 of file qdeclarativeengine.cpp.

1160 {
1162  extendedData->boundSignals.append(signal);
1163 }
QDeclarativeDataExtended * extendedData
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QList< QDeclarativeAbstractBoundSignal * > boundSignals

◆ attachedProperties()

QHash< int, QObject * > * QDeclarativeData::attachedProperties ( ) const

Definition at line 1153 of file qdeclarativeengine.cpp.

Referenced by qmlAttachedPropertiesObjectById().

1154 {
1157 }
QHash< int, QObject * > attachedProperties
QDeclarativeDataExtended * extendedData

◆ clearBindingBit()

void QDeclarativeData::clearBindingBit ( int  bit)

Definition at line 1247 of file qdeclarativeengine.cpp.

Referenced by QDeclarativeAbstractBinding::removeFromObject().

1248 {
1249  if (bindingBitsSize > bit)
1250  bindingBits[bit / 32] &= ~(1 << (bit % 32));
1251 }

◆ destroyed() [1/2]

void QDeclarativeData::destroyed ( QAbstractDeclarativeData d,
QObject o 
)
static

Definition at line 566 of file qdeclarativeengine.cpp.

567 {
568  static_cast<QDeclarativeData *>(d)->destroyed(o);
569 }
double d
Definition: qnumeric_p.h:62
static void destroyed(QAbstractDeclarativeData *, QObject *)

◆ destroyed() [2/2]

void QDeclarativeData::destroyed ( QObject object)

Definition at line 1185 of file qdeclarativeengine.cpp.

1186 {
1187  if (deferredComponent)
1189 
1190  if (nextContextObject)
1192  if (prevContextObject)
1194 
1196  while (binding) {
1197  QDeclarativeAbstractBinding *next = binding->m_nextBinding;
1198  binding->m_prevBinding = 0;
1199  binding->m_nextBinding = 0;
1201  binding = next;
1202  }
1203 
1204  if (bindingBits)
1205  free(bindingBits);
1206 
1207  if (propertyCache)
1209 
1210  if (ownContext && context)
1211  context->destroy();
1212 
1213  while (guards) {
1215  *guard = (QObject *)0;
1216  guard->objectDestroyed(object);
1217  }
1218 
1219  if (scriptValue)
1220  delete scriptValue;
1221 
1222  if (extendedData)
1223  delete extendedData;
1224 
1225  if (ownMemory)
1226  delete this;
1227 }
QDeclarativeContextData * context
QDeclarativePropertyCache * propertyCache
virtual void destroy(DestroyMode mode=DisconnectBinding)
Destroy the binding.
QDeclarativeAbstractBinding * bindings
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QDeclarativeDataExtended * extendedData
QDeclarativeCompiledData * deferredComponent
QDeclarativeAbstractBinding * m_nextBinding
QDeclarativeData ** prevContextObject
QDeclarativeData * nextContextObject
QDeclarativeGuardImpl * guards
QDeclarativeAbstractBinding ** m_prevBinding
QScriptValue * scriptValue

◆ disconnectNotifiers()

void QDeclarativeData::disconnectNotifiers ( )

Definition at line 1171 of file qdeclarativeengine.cpp.

Referenced by QDeclarativePrivate::qdeclarativeelement_destructor().

1172 {
1174  while (binding) {
1176  binding = binding->m_nextBinding;
1177  }
1178 
1179  if (extendedData) {
1181  signal->disconnect();
1182  }
1183 }
QDeclarativeAbstractBinding * bindings
QDeclarativeDataExtended * extendedData
QList< QDeclarativeAbstractBoundSignal * > boundSignals
QDeclarativeAbstractBinding * m_nextBinding
virtual void disconnect(DisconnectMode disconnectMode)=0
#define Q_FOREACH(variable, container)
Same as foreach(variable, container).
Definition: qglobal.h:2435

◆ get()

static QDeclarativeData* QDeclarativeData::get ( const QObject object,
bool  create = false 
)
inlinestatic

Definition at line 140 of file qdeclarativedata_p.h.

Referenced by QDeclarativeGuardImpl::addGuard(), QDeclarativeContextData::addObject(), QDeclarativeAbstractBinding::addToObject(), QDeclarativeComponent::beginCreate(), QDeclarativePropertyPrivate::binding(), QDeclarativeComponentPrivate::complete(), QDeclarativeConnections::connectSignals(), QDeclarativeEnginePrivate::createComponent(), QDeclarativeComponentPrivate::createObject(), QDeclarativeEnginePrivate::createQmlObject(), QDeclarativePropertyChangesPrivate::decode(), QDeclarativeObjectScriptClass::destroy(), QDeclarativeStateChangeScript::execute(), QDeclarativeScriptActionPrivate::execute(), QDeclarativePropertyPrivate::findAliasTarget(), QDeclarativeBoundSignal::init(), QDeclarativeVMEMetaObject::metaCall(), QDeclarativeObjectScriptClass::newQObject(), ObjectData::ObjectData(), QDeclarativeEngineDebugService::objectData(), QDeclarativeEngine::objectOwnership(), QDeclarativeObjectMethodScriptClass::property(), QDeclarativeObjectScriptClass::property(), QDeclarativePropertyCache::property(), QDeclarativeObjectScriptClass::propertyNames(), QDeclarativeComponent::qmlAttachedProperties(), qmlAttachedPropertiesObjectById(), qmlExecuteDeferred(), QObject_objectName(), QDeclarativeObjectScriptClass::queryProperty(), QDeclarativeObjectMethodScriptClass::relatedMethod(), QDeclarativeAbstractBinding::removeFromObject(), QDeclarativeVME::run(), QDeclarativeVME::runDeferred(), QDeclarativePropertyPrivate::setBinding(), QDeclarativePropertyPrivate::setBindingNoEnable(), QDeclarativeOpenMetaObject::setCached(), QDeclarativeEngine::setContextForObject(), QDeclarativeEngine::setObjectOwnership(), QDeclarativeVisualDataModel::stringValue(), QDeclarativeBoundSignal::unregisterScopeObject(), ObjectData::~ObjectData(), and QDeclarativeInfo::~QDeclarativeInfo().

140  {
141  QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
142  if (priv->wasDeleted) {
143  Q_ASSERT(!create);
144  return 0;
145  } else if (priv->declarativeData) {
146  return static_cast<QDeclarativeData *>(priv->declarativeData);
147  } else if (create) {
148  priv->declarativeData = new QDeclarativeData;
149  return static_cast<QDeclarativeData *>(priv->declarativeData);
150  } else {
151  return 0;
152  }
153  }
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
uint wasDeleted
Definition: qobject.h:98
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
QAbstractDeclarativeData * declarativeData
Definition: qobject_p.h:214
static const QMetaObjectPrivate * priv(const uint *data)

◆ hasBindingBit()

bool QDeclarativeData::hasBindingBit ( int  bit) const

◆ hasExtendedData()

bool QDeclarativeData::hasExtendedData ( ) const
inline

Definition at line 155 of file qdeclarativedata_p.h.

Referenced by qmlAttachedPropertiesObjectById().

155 { return extendedData != 0; }
QDeclarativeDataExtended * extendedData

◆ init()

static void QDeclarativeData::init ( )
inlinestatic

Definition at line 85 of file qdeclarativedata_p.h.

Referenced by QDeclarativeEnginePrivate::init().

85  {
89  }
static void(* objectNameChanged)(QAbstractDeclarativeData *, QObject *)
Definition: qobject_p.h:95
static void objectNameChanged(QAbstractDeclarativeData *, QObject *)
static void parentChanged(QAbstractDeclarativeData *, QObject *, QObject *)
static void destroyed(QAbstractDeclarativeData *, QObject *)
static void(* parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *)
Definition: qobject_p.h:94
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
Definition: qobject_p.h:93

◆ objectNameChanged() [1/2]

void QDeclarativeData::objectNameChanged ( QAbstractDeclarativeData d,
QObject o 
)
static

Definition at line 576 of file qdeclarativeengine.cpp.

577 {
578  static_cast<QDeclarativeData *>(d)->objectNameChanged(o);
579 }
double d
Definition: qnumeric_p.h:62
static void objectNameChanged(QAbstractDeclarativeData *, QObject *)

◆ objectNameChanged() [2/2]

void QDeclarativeData::objectNameChanged ( QObject )

Definition at line 1234 of file qdeclarativeengine.cpp.

1235 {
1237 }
QDeclarativeDataExtended * extendedData
QDeclarativeNotifier * objectNameNotifier() const

◆ objectNameNotifier()

QDeclarativeNotifier * QDeclarativeData::objectNameNotifier ( ) const

Definition at line 1147 of file qdeclarativeengine.cpp.

1148 {
1151 }
QDeclarativeDataExtended * extendedData
QDeclarativeNotifier objectNameNotifier

◆ parentChanged() [1/2]

void QDeclarativeData::parentChanged ( QAbstractDeclarativeData d,
QObject o,
QObject p 
)
static

Definition at line 571 of file qdeclarativeengine.cpp.

572 {
573  static_cast<QDeclarativeData *>(d)->parentChanged(o, p);
574 }
double d
Definition: qnumeric_p.h:62
static void parentChanged(QAbstractDeclarativeData *, QObject *, QObject *)

◆ parentChanged() [2/2]

void QDeclarativeData::parentChanged ( QObject ,
QObject parent 
)

Definition at line 1229 of file qdeclarativeengine.cpp.

1230 {
1231  if (!parent && scriptValue) { delete scriptValue; scriptValue = 0; }
1232 }
QScriptValue * scriptValue

◆ removeBoundSignal()

void QDeclarativeData::removeBoundSignal ( QDeclarativeAbstractBoundSignal signal)

Definition at line 1165 of file qdeclarativeengine.cpp.

Referenced by QDeclarativeBoundSignal::unregisterScopeObject().

1166 {
1167  if (extendedData)
1169 }
QDeclarativeDataExtended * extendedData
QList< QDeclarativeAbstractBoundSignal * > boundSignals
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ setBindingBit()

void QDeclarativeData::setBindingBit ( QObject obj,
int  bit 
)

Definition at line 1253 of file qdeclarativeengine.cpp.

Referenced by QDeclarativeAbstractBinding::addToObject().

1254 {
1255  if (bindingBitsSize <= bit) {
1256  int props = obj->metaObject()->propertyCount();
1257  Q_ASSERT(bit < props);
1258 
1259  int arraySize = (props + 31) / 32;
1260  int oldArraySize = bindingBitsSize / 32;
1261 
1263  arraySize * sizeof(quint32)));
1264 
1265  memset(bindingBits + oldArraySize,
1266  0x00,
1267  sizeof(quint32) * (arraySize - oldArraySize));
1268 
1269  bindingBitsSize = arraySize * 32;
1270  }
1271 
1272  bindingBits[bit / 32] |= (1 << (bit % 32));
1273 }
T * q_check_ptr(T *p)
Definition: qglobal.h:1857
int propertyCount() const
Returns the number of properties in this class, including the number of properties provided by each b...
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
unsigned int quint32
Definition: qglobal.h:938
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.

◆ setImplicitDestructible()

void QDeclarativeData::setImplicitDestructible ( )
inline

Properties

◆ bindingBits

quint32* QDeclarativeData::bindingBits

Definition at line 121 of file qdeclarativedata_p.h.

Referenced by fastHasBinding().

◆ bindingBitsSize

int QDeclarativeData::bindingBitsSize

Definition at line 120 of file qdeclarativedata_p.h.

Referenced by fastHasBinding().

◆ bindings

QDeclarativeAbstractBinding* QDeclarativeData::bindings

◆ columnNumber

ushort QDeclarativeData::columnNumber

◆ context

QDeclarativeContextData* QDeclarativeData::context

◆ deferredComponent

QDeclarativeCompiledData* QDeclarativeData::deferredComponent

Definition at line 129 of file qdeclarativedata_p.h.

Referenced by qmlExecuteDeferred(), and QDeclarativeVME::runDeferred().

◆ deferredIdx

unsigned int QDeclarativeData::deferredIdx

Definition at line 130 of file qdeclarativedata_p.h.

Referenced by QDeclarativeVME::runDeferred().

◆ dummy

quint32 QDeclarativeData::dummy

Definition at line 107 of file qdeclarativedata_p.h.

◆ explicitIndestructibleSet

quint32 QDeclarativeData::explicitIndestructibleSet

Definition at line 106 of file qdeclarativedata_p.h.

Referenced by QDeclarativeEngine::setObjectOwnership().

◆ extendedData

QDeclarativeDataExtended* QDeclarativeData::extendedData
mutableprivate

Definition at line 164 of file qdeclarativedata_p.h.

◆ guards

QDeclarativeGuardImpl* QDeclarativeData::guards

Definition at line 138 of file qdeclarativedata_p.h.

Referenced by QDeclarativeGuardImpl::addGuard().

◆ indestructible

quint32 QDeclarativeData::indestructible

◆ lineNumber

ushort QDeclarativeData::lineNumber

◆ nextContextObject

QDeclarativeData* QDeclarativeData::nextContextObject

◆ objectDataRefCount

quint32 QDeclarativeData::objectDataRefCount

Definition at line 135 of file qdeclarativedata_p.h.

Referenced by ObjectData::ObjectData(), and ObjectData::~ObjectData().

◆ outerContext

QDeclarativeContextData* QDeclarativeData::outerContext

◆ ownContext

quint32 QDeclarativeData::ownContext

◆ ownMemory

quint32 QDeclarativeData::ownMemory

◆ prevContextObject

QDeclarativeData** QDeclarativeData::prevContextObject

◆ propertyCache

QDeclarativePropertyCache* QDeclarativeData::propertyCache

◆ scriptValue

QScriptValue* QDeclarativeData::scriptValue

Definition at line 134 of file qdeclarativedata_p.h.

Referenced by QDeclarativeObjectScriptClass::newQObject().


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