Qt 4.8
Classes | Typedefs | Enumerations | Functions
QDeclarativePrivate Namespace Reference

Classes

class  AttachedPropertySelector
 
class  AttachedPropertySelector< T, 1 >
 
struct  has_attachedPropertiesMember
 
class  has_attachedPropertiesMethod
 
class  has_attachedPropertiesMethod< T, false >
 
class  QDeclarativeElement
 
struct  RegisterAutoParent
 
struct  RegisterComponent
 
struct  RegisterInterface
 
struct  RegisterType
 
struct  StaticCastSelector
 
struct  StaticCastSelectorClass
 
struct  StaticCastSelectorClass< From, To, sizeof(int)>
 

Typedefs

typedef AutoParentResult(* AutoParentFunction) (QObject *object, QObject *parent)
 

Enumerations

enum  AutoParentResult { Parented, IncompatibleObject, IncompatibleParent }
 
enum  RegistrationType { TypeRegistration = 0, InterfaceRegistration = 1, AutoParentRegistration = 2, ComponentRegistration = 3 }
 

Functions

template<typename T >
QDeclarativeAttachedPropertiesFunc attachedPropertiesFunc ()
 
template<typename T >
const QMetaObjectattachedPropertiesMetaObject ()
 
template<typename T >
void createInto (void *memory)
 
template<typename T >
QObjectcreateParent (QObject *p)
 
void Q_DECLARATIVE_EXPORT qdeclarativeelement_destructor (QObject *)
 
int Q_DECLARATIVE_EXPORT qmlregister (RegistrationType, void *)
 
int qmlRegisterType (const QUrl &url, const char *uri, int versionMajor, int versionMinor, const char *qmlName)
 
template<typename T , int metaObjectRevision>
int qmlRegisterUncreatableType (const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &reason)
 

Typedef Documentation

◆ AutoParentFunction

typedef AutoParentResult(* QDeclarativePrivate::AutoParentFunction) (QObject *object, QObject *parent)

Definition at line 194 of file qdeclarativeprivate.h.

Enumeration Type Documentation

◆ AutoParentResult

◆ RegistrationType

Enumerator
TypeRegistration 
InterfaceRegistration 
AutoParentRegistration 
ComponentRegistration 

Definition at line 249 of file qdeclarativeprivate.h.

Function Documentation

◆ attachedPropertiesFunc()

template<typename T >
QDeclarativeAttachedPropertiesFunc QDeclarativePrivate::attachedPropertiesFunc ( )
inline

Definition at line 182 of file qdeclarativeprivate.h.

183  {
184  return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func();
185  }

◆ attachedPropertiesMetaObject()

template<typename T >
const QMetaObject* QDeclarativePrivate::attachedPropertiesMetaObject ( )
inline

Definition at line 188 of file qdeclarativeprivate.h.

Referenced by QDeclarativePrivate::AttachedPropertySelector< T, 1 >::metaObject().

189  {
190  return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();
191  }

◆ createInto()

template<typename T >
void QDeclarativePrivate::createInto ( void *  memory)

Definition at line 96 of file qdeclarativeprivate.h.

96 { new (memory) QDeclarativeElement<T>; }

◆ createParent()

template<typename T >
QObject* QDeclarativePrivate::createParent ( QObject p)

Definition at line 99 of file qdeclarativeprivate.h.

99 { return new T(p); }

◆ qdeclarativeelement_destructor()

void QDeclarativePrivate::qdeclarativeelement_destructor ( QObject o)

Definition at line 549 of file qdeclarativeengine.cpp.

Referenced by QDeclarativePrivate::QDeclarativeElement< T >::~QDeclarativeElement().

550 {
552  if (p->declarativeData) {
553  QDeclarativeData *d = static_cast<QDeclarativeData*>(p->declarativeData);
554  if (d->ownContext && d->context) {
555  d->context->destroy();
556  d->context = 0;
557  }
558 
559  // Disconnect the notifiers now - during object destruction this would be too late, since
560  // the disconnect call wouldn't be able to call disconnectNotify(), as it isn't possible to
561  // get the metaobject anymore.
562  d->disconnectNotifiers();
563  }
564 }
double d
Definition: qnumeric_p.h:62
QDeclarativeContextData * context
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177
QAbstractDeclarativeData * declarativeData
Definition: qobject_p.h:214

◆ qmlregister()

int QDeclarativePrivate::qmlregister ( RegistrationType  type,
void *  data 
)

Definition at line 722 of file qdeclarativemetatype.cpp.

Referenced by QDeclarativeItemModule::defineModule(), qmlRegisterCustomType(), qmlRegisterExtendedType(), qmlRegisterInterface(), qmlRegisterRevision(), qmlRegisterType(), qmlRegisterType(), qmlRegisterUncreatableType(), qmlRegisterUncreatableType(), and qmlRegisterValueTypeEnums().

723 {
724  if (type == TypeRegistration) {
725  return registerType(*reinterpret_cast<RegisterType *>(data));
726  } else if (type == InterfaceRegistration) {
727  return registerInterface(*reinterpret_cast<RegisterInterface *>(data));
728  } else if (type == AutoParentRegistration) {
729  return registerAutoParentFunction(*reinterpret_cast<RegisterAutoParent *>(data));
730  } else if (type == ComponentRegistration) {
731  return registerComponent(*reinterpret_cast<RegisterComponent *>(data));
732  }
733  return -1;
734 }
int registerInterface(const QDeclarativePrivate::RegisterInterface &interface)
int type
Definition: qmetatype.cpp:239
int registerType(const QDeclarativePrivate::RegisterType &type)
static const char * data(const QByteArray &arr)
int registerAutoParentFunction(QDeclarativePrivate::RegisterAutoParent &autoparent)
int registerComponent(const QDeclarativePrivate::RegisterComponent &data)

◆ qmlRegisterType()

int QDeclarativePrivate::qmlRegisterType ( const QUrl url,
const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName 
)
inline

Definition at line 274 of file qdeclarativeprivate.h.

275  {
276  RegisterComponent type = {
277  url,
278  uri,
279  qmlName,
280  versionMajor,
281  versionMinor
282  };
283 
285  }
int type
Definition: qmetatype.cpp:239
int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *)

◆ qmlRegisterUncreatableType()

template<typename T , int metaObjectRevision>
int QDeclarativePrivate::qmlRegisterUncreatableType ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName,
const QString reason 
)

Definition at line 294 of file qdeclarativeprivate.h.

295  {
296  QByteArray name(T::staticMetaObject.className());
297 
298  QByteArray pointerName(name + '*');
299  QByteArray listName("QDeclarativeListProperty<" + name + ">");
300 
302  1,
303 
304  qRegisterMetaType<T *>(pointerName.constData()),
305  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
306  0, 0,
307  reason,
308 
309  uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
310 
311  QDeclarativePrivate::attachedPropertiesFunc<T>(),
312  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
313 
317 
318  0, 0,
319 
320  0,
321  metaObjectRevision
322  };
323 
325  }
int type
Definition: qmetatype.cpp:239
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
int qRegisterMetaType()
Call this function to register the type T.
Definition: qmetatype.h:234
const char * className
Definition: qwizard.cpp:137
const char * name
int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *)
The QDeclarativeListProperty class allows applications to expose list-like properties to QML...