Qt 4.8
Public Functions | Protected Functions | Properties | Friends | List of all members
QDeclarativeOpenMetaObjectType Class Reference

#include <qdeclarativeopenmetaobject_p.h>

Inheritance diagram for QDeclarativeOpenMetaObjectType:
QDeclarativeRefCount VDMDelegateDataType

Public Functions

int createProperty (const QByteArray &name)
 
int propertyOffset () const
 
 QDeclarativeOpenMetaObjectType (const QMetaObject *base, QDeclarativeEngine *engine)
 
int signalOffset () const
 
 ~QDeclarativeOpenMetaObjectType ()
 
- Public Functions inherited from QDeclarativeRefCount
void addref ()
 
 QDeclarativeRefCount ()
 
void release ()
 
virtual ~QDeclarativeRefCount ()
 

Protected Functions

virtual void propertyCreated (int, QMetaPropertyBuilder &)
 

Properties

QDeclarativeOpenMetaObjectTypePrivated
 

Friends

class QDeclarativeOpenMetaObject
 
class QDeclarativeOpenMetaObjectPrivate
 

Detailed Description

Definition at line 61 of file qdeclarativeopenmetaobject_p.h.

Constructors and Destructors

◆ QDeclarativeOpenMetaObjectType()

QDeclarativeOpenMetaObjectType::QDeclarativeOpenMetaObjectType ( const QMetaObject base,
QDeclarativeEngine engine 
)

◆ ~QDeclarativeOpenMetaObjectType()

QDeclarativeOpenMetaObjectType::~QDeclarativeOpenMetaObjectType ( )

Definition at line 75 of file qdeclarativeopenmetaobject.cpp.

76 {
77  if (d->mem)
78  qFree(d->mem);
79  if (d->cache)
80  d->cache->release();
81  delete d;
82 }
Q_CORE_EXPORT void qFree(void *ptr)
Definition: qmalloc.cpp:58
QDeclarativeOpenMetaObjectTypePrivate * d

Functions

◆ createProperty()

int QDeclarativeOpenMetaObjectType::createProperty ( const QByteArray name)

Definition at line 95 of file qdeclarativeopenmetaobject.cpp.

Referenced by QDeclarativeOpenMetaObject::createProperty().

96 {
97  int id = d->mob.propertyCount();
98  d->mob.addSignal("__" + QByteArray::number(id) + "()");
99  QMetaPropertyBuilder build = d->mob.addProperty(name, "QVariant", id);
100  propertyCreated(id, build);
101  qFree(d->mem);
102  d->mem = d->mob.toMetaObject();
103  d->names.insert(name, id);
105  while (it != d->referers.end()) {
107  *static_cast<QMetaObject *>(omo) = *d->mem;
108  if (d->cache)
109  d->cache->update(d->engine, omo);
110  ++it;
111  }
112 
113  return d->propertyOffset + id;
114 }
virtual void propertyCreated(int, QMetaPropertyBuilder &)
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
#define it(className, varName)
The QMetaPropertyBuilder class enables modifications to a property definition on a meta object builde...
Q_CORE_EXPORT void qFree(void *ptr)
Definition: qmalloc.cpp:58
void update(QDeclarativeEngine *, const QMetaObject *)
iterator begin()
Definition: qset.h:166
QSet< QDeclarativeOpenMetaObject * > referers
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
QMetaPropertyBuilder addProperty(const QByteArray &name, const QByteArray &type, int notifierId=-1)
Adds a new readable/writable property to this class with the specified name and type.
iterator end()
Definition: qset.h:169
if(void) toggleToolbarShown
QDeclarativeOpenMetaObjectTypePrivate * d
QMetaObject * toMetaObject() const
Converts this meta object builder into a concrete QMetaObject.
QMetaMethodBuilder addSignal(const QByteArray &signature)
Adds a new signal to this class with the specified signature.
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
int propertyCount() const
Returns the number of properties in this class, excluding the number of properties in the base class...

◆ propertyCreated()

void QDeclarativeOpenMetaObjectType::propertyCreated ( int  id,
QMetaPropertyBuilder builder 
)
protectedvirtual

Reimplemented in VDMDelegateDataType.

Definition at line 116 of file qdeclarativeopenmetaobject.cpp.

Referenced by createProperty().

117 {
118  if (d->referers.count())
119  (*d->referers.begin())->propertyCreated(id, builder);
120 }
virtual void propertyCreated(int, QMetaPropertyBuilder &)
iterator begin()
Definition: qset.h:166
QSet< QDeclarativeOpenMetaObject * > referers
int count() const
Definition: qset.h:178
QDeclarativeOpenMetaObjectTypePrivate * d

◆ propertyOffset()

int QDeclarativeOpenMetaObjectType::propertyOffset ( ) const

◆ signalOffset()

int QDeclarativeOpenMetaObjectType::signalOffset ( ) const

Friends and Related Functions

◆ QDeclarativeOpenMetaObject

Definition at line 77 of file qdeclarativeopenmetaobject_p.h.

◆ QDeclarativeOpenMetaObjectPrivate

Definition at line 78 of file qdeclarativeopenmetaobject_p.h.

Properties

◆ d

QDeclarativeOpenMetaObjectTypePrivate* QDeclarativeOpenMetaObjectType::d
private

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