Qt 4.8
Macros | Enumerations | Functions
qdeclarative.h File Reference
#include <QtDeclarative/qdeclarativeprivate.h>
#include <QtDeclarative/qdeclarativeparserstatus.h>
#include <QtDeclarative/qdeclarativepropertyvaluesource.h>
#include <QtDeclarative/qdeclarativepropertyvalueinterceptor.h>
#include <QtDeclarative/qdeclarativelist.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qmetaobject.h>

Go to the source code of this file.

Macros

#define QML_DECLARE_INTERFACE(INTERFACE)   QML_DECLARE_TYPE(INTERFACE)
 
#define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE)   QML_DECLARE_TYPE_HASMETATYPE(INTERFACE)
 
#define QML_DECLARE_TYPE(TYPE)
 
#define QML_DECLARE_TYPE_HASMETATYPE(TYPE)   Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
 
#define QML_DECLARE_TYPEINFO(TYPE, FLAGS)
 

Enumerations

enum  { QML_HAS_ATTACHED_PROPERTIES = 0x01 }
 

Functions

Q_DECLARATIVE_EXPORT QObjectqmlAttachedPropertiesObject (int *, const QObject *, const QMetaObject *, bool create)
 
template<typename T >
QObjectqmlAttachedPropertiesObject (const QObject *obj, bool create=true)
 
Q_DECLARATIVE_EXPORT QObjectqmlAttachedPropertiesObjectById (int, const QObject *, bool create=true)
 
Q_DECLARATIVE_EXPORT QDeclarativeContextqmlContext (const QObject *)
 
Q_DECLARATIVE_EXPORT QDeclarativeEngineqmlEngine (const QObject *)
 
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred (QObject *)
 
template<typename T >
int qmlRegisterCustomType (const char *uri, int versionMajor, int versionMinor, const char *qmlName, QDeclarativeCustomParser *parser)
 
template<typename T , typename E >
int qmlRegisterExtendedType ()
 
template<typename T , typename E >
int qmlRegisterExtendedType (const char *uri, int versionMajor, int versionMinor, const char *qmlName)
 
template<typename T >
int qmlRegisterInterface (const char *typeName)
 
template<typename T , int metaObjectRevision>
int qmlRegisterRevision (const char *uri, int versionMajor, int versionMinor)
 
template<typename T >
int qmlRegisterType ()
 
template<typename T >
int qmlRegisterType (const char *uri, int versionMajor, int versionMinor, const char *qmlName)
 
template<typename T , int metaObjectRevision>
int qmlRegisterType (const char *uri, int versionMajor, int versionMinor, const char *qmlName)
 
int Q_AUTOTEST_EXPORT qmlRegisterTypeNotAvailable (const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &message)
 
template<typename T >
int qmlRegisterUncreatableType (const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &reason)
 

Macro Definition Documentation

◆ QML_DECLARE_INTERFACE

#define QML_DECLARE_INTERFACE (   INTERFACE)    QML_DECLARE_TYPE(INTERFACE)

Definition at line 63 of file qdeclarative.h.

◆ QML_DECLARE_INTERFACE_HASMETATYPE

#define QML_DECLARE_INTERFACE_HASMETATYPE (   INTERFACE)    QML_DECLARE_TYPE_HASMETATYPE(INTERFACE)

Definition at line 66 of file qdeclarative.h.

◆ QML_DECLARE_TYPE

#define QML_DECLARE_TYPE (   TYPE)
Value:
Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)
#define Q_DECLARE_METATYPE(TYPE)
This macro makes the type Type known to QMetaType as long as it provides a public default constructor...
Definition: qmetatype.h:265
The QDeclarativeListProperty class allows applications to expose list-like properties to QML...

Definition at line 56 of file qdeclarative.h.

Referenced by QDeclarativeVisualDataModel::_q_destroyingPackage(), QDeclarativeAnchorChanges::needsCopy(), QDeclarativePropertyChangesParser::QDeclarativePropertyChangesParser(), qmlAttachedPropertiesObject(), and qobject_cast().

◆ QML_DECLARE_TYPE_HASMETATYPE

#define QML_DECLARE_TYPE_HASMETATYPE (   TYPE)    Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>)

Definition at line 60 of file qdeclarative.h.

◆ QML_DECLARE_TYPEINFO

#define QML_DECLARE_TYPEINFO (   TYPE,
  FLAGS 
)
Value:
QT_BEGIN_NAMESPACE \
template <> \
{ \
public: \
enum { \
hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \
}; \
}; \
QT_END_NAMESPACE

Definition at line 73 of file qdeclarative.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
QML_HAS_ATTACHED_PROPERTIES 

Definition at line 69 of file qdeclarative.h.

69  { /* TYPEINFO flags */
71 };

Function Documentation

◆ qmlAttachedPropertiesObject() [1/2]

Q_DECLARATIVE_EXPORT QObject* qmlAttachedPropertiesObject ( int *  ,
const QObject ,
const QMetaObject ,
bool  create 
)

Definition at line 1106 of file qdeclarativeengine.cpp.

Referenced by qmlAttachedPropertiesObject(), and qmlRegisterCustomType().

1108 {
1109  if (*idCache == -1)
1110  *idCache = QDeclarativeMetaType::attachedPropertiesFuncId(attachedMetaObject);
1111 
1112  if (*idCache == -1 || !object)
1113  return 0;
1114 
1115  return qmlAttachedPropertiesObjectById(*idCache, object, create);
1116 }
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
static int attachedPropertiesFuncId(const QMetaObject *)
QObject * qmlAttachedPropertiesObjectById(int id, const QObject *object, bool create)

◆ qmlAttachedPropertiesObject() [2/2]

template<typename T >
QObject* qmlAttachedPropertiesObject ( const QObject obj,
bool  create = true 
)

Definition at line 402 of file qdeclarative.h.

403 {
404  static int idx = -1;
405  return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create);
406 }
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
Q_DECLARATIVE_EXPORT QObject * qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create)

◆ qmlAttachedPropertiesObjectById()

Q_DECLARATIVE_EXPORT QObject* qmlAttachedPropertiesObjectById ( int  ,
const QObject ,
bool  create = true 
)

Definition at line 1084 of file qdeclarativeengine.cpp.

Referenced by QDeclarativePropertyPrivate::initProperty(), qmlAttachedPropertiesObject(), qmlRegisterCustomType(), QDeclarativeTypeNameScriptClass::queryProperty(), and QDeclarativeCompiledBindingsPrivate::run().

1085 {
1087  if (!data)
1088  return 0; // Attached properties are only on objects created by QML
1089 
1090  QObject *rv = data->hasExtendedData()?data->attachedProperties()->value(id):0;
1091  if (rv || !create)
1092  return rv;
1093 
1095  if (!pf)
1096  return 0;
1097 
1098  rv = pf(const_cast<QObject *>(object));
1099 
1100  if (rv)
1101  data->attachedProperties()->insert(id, rv);
1102 
1103  return rv;
1104 }
QObject *(* QDeclarativeAttachedPropertiesFunc)(QObject *)
static QDeclarativeData * get(const QObject *object, bool create=false)
static QDeclarativeAttachedPropertiesFunc attachedPropertiesFuncById(int)
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
QHash< int, QObject * > * attachedProperties() const
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
static const char * data(const QByteArray &arr)
bool hasExtendedData() const

◆ qmlContext()

Definition at line 1073 of file qdeclarativeengine.cpp.

Referenced by QDeclarativeLoaderPrivate::_q_sourceLoaded(), QDeclarativePropertyChanges::actions(), QDeclarativeParentChange::actions(), QDeclarativeAnchorChanges::actions(), QDeclarativeAnchorChanges::additionalActions(), QDeclarativeWatcher::addWatch(), QDeclarativePropertyChanges::changeExpression(), QDeclarativeGestureArea::connectSignals(), QDeclarativeConnections::connectSignals(), QDeclarativeGridViewPrivate::createComponentItem(), QDeclarativeListViewPrivate::createComponentItem(), QDeclarativePathViewPrivate::createHighlight(), QDeclarativeAbstractAnimationPrivate::createProperty(), QDeclarativeListViewPrivate::createSection(), QDeclarativeComponent::creationContext(), QDeclarativePropertyChangesPrivate::decode(), QDeclarativeXmlListModel::get(), QDeclarativeVisualDataModel::item(), QDeclarativeTextEdit::loadCursorDelegate(), QTextDocumentWithImageResources::loadResource(), QDeclarativeEngineDebugService::messageReceived(), QDeclarativeEngineDebugService::objectData(), QDeclarativePropertyChangesPrivate::property(), qmlRegisterCustomType(), QDeclarativeXmlListModel::reload(), QDeclarativeEngineDebugService::resetBinding(), QDeclarativeEngineDebugService::setBinding(), QDeclarativeRepeater::setDelegate(), QDeclarativeGridView::setDelegate(), QDeclarativePathView::setDelegate(), QDeclarativeListView::setDelegate(), QDeclarativeEngineDebugService::setMethodBody(), QDeclarativeRepeater::setModel(), QDeclarativePathView::setModel(), QDeclarativeGridView::setModel(), QDeclarativeListView::setModel(), and QDeclarativeFontLoader::setSource().

1074 {
1076 }
static QDeclarativeContext * contextForObject(const QObject *)
Returns the QDeclarativeContext for the object, or 0 if no context has been set.

◆ qmlEngine()

Definition at line 1078 of file qdeclarativeengine.cpp.

Referenced by QDeclarativeLoaderPrivate::_q_sourceLoaded(), QDeclarativeXmlListModel::classBegin(), QDeclarativePathView::createdItem(), QDeclarativeWorkerScript::engine(), QDeclarativeWorkerScript::event(), FlatListModel::get(), NestedListModel::get(), QDeclarativePathViewPrivate::getItem(), QDeclarativeBorderImage::load(), QDeclarativeImageBase::load(), QDeclarativeAnimatedImage::load(), QDeclarativeItem::mapFromItem(), QDeclarativeItem::mapToItem(), ModelNode::object(), QDeclarativeComponent::qmlAttachedProperties(), qmlRegisterCustomType(), QDeclarativeXmlListModel::reload(), QDeclarativeXmlListModel::requestFinished(), QDeclarativeBorderImage::setGridScaledImage(), QDeclarativeVisualDataModel::setModel(), QDeclarativeAbstractAnimation::setRunning(), QDeclarativeLoader::setSource(), QDeclarativeFontLoader::setSource(), QDeclarativeParticles::setSource(), QDeclarativeBehavior::setTarget(), and QDeclarativeInfo::~QDeclarativeInfo().

1079 {
1081  return context?context->engine():0;
1082 }
The QDeclarativeContext class defines a context within a QML engine.
QDeclarativeEngine * engine() const
Return the context&#39;s QDeclarativeEngine, or 0 if the context has no QDeclarativeEngine or the QDeclar...
static QDeclarativeContext * contextForObject(const QObject *)
Returns the QDeclarativeContext for the object, or 0 if no context has been set.

◆ qmlExecuteDeferred()

Q_DECLARATIVE_EXPORT void qmlExecuteDeferred ( QObject )

Definition at line 1047 of file qdeclarativeengine.cpp.

Referenced by QDeclarativeState::apply(), QDeclarativeStatePrivate::generateActionList(), QDeclarativeTransition::prepare(), QDeclarativeEngineDebugService::prepareDeferredObjects(), qmlRegisterCustomType(), and QDeclarativeBehavior::write().

1048 {
1050 
1051  if (data && data->deferredComponent) {
1054  QDeclarativeType *type = QDeclarativeMetaType::qmlType(object->metaObject());
1055  QString typeName = type ? QLatin1String(type->qmlTypeName()) : QString::fromLatin1(object->metaObject()->className());
1057  if (data->outerContext)
1059  }
1061 
1063  QDeclarativeComponentPrivate::beginDeferred(ep, object, &state);
1064 
1065  data->deferredComponent->release();
1066  data->deferredComponent = 0;
1067 
1070  }
1071 }
QDeclarativeContextData * outerContext
QDeclarativeContextData * context
static QDeclarativeData * get(const QObject *object, bool create=false)
int type
Definition: qmetatype.cpp:239
QDeclarativeEngine * engine
static void rangeLocation(RangeType, const QString &, int)
static QDeclarativeType * qmlType(const QByteArray &, int, int)
Returns the type (if any) of URI-qualified named name in version specified by version_major and versi...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
QDeclarativeCompiledData * deferredComponent
const char * typeName
Definition: qmetatype.cpp:239
static const char * data(const QByteArray &arr)
QByteArray qmlTypeName() const
static void complete(QDeclarativeEnginePrivate *enginePriv, ConstructionState *state)
static void beginDeferred(QDeclarativeEnginePrivate *enginePriv, QObject *object, ConstructionState *state)
static void endRange(RangeType)
static void startRange(RangeType)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static void rangeData(RangeType, const QString &)

◆ qmlRegisterCustomType()

template<typename T >
int qmlRegisterCustomType ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName,
QDeclarativeCustomParser parser 
)

Definition at line 359 of file qdeclarative.h.

361 {
362  QByteArray name(T::staticMetaObject.className());
363 
364  QByteArray pointerName(name + '*');
365  QByteArray listName("QDeclarativeListProperty<" + name + ">");
366 
368  0,
369 
370  qRegisterMetaType<T *>(pointerName.constData()),
371  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
372  sizeof(T), QDeclarativePrivate::createInto<T>,
373  QString(),
374 
375  uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
376 
377  QDeclarativePrivate::attachedPropertiesFunc<T>(),
378  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
379 
383 
384  0, 0,
385 
386  parser,
387  0
388  };
389 
391 }
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterExtendedType() [1/2]

template<typename T , typename E >
int qmlRegisterExtendedType ( )

Definition at line 263 of file qdeclarative.h.

264 {
265  QByteArray name(T::staticMetaObject.className());
266 
267  QByteArray pointerName(name + '*');
268  QByteArray listName("QDeclarativeListProperty<" + name + ">");
269 
271  0,
272 
273  qRegisterMetaType<T *>(pointerName.constData()),
274  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
275  0, 0,
276  QString(),
277 
278  0, 0, 0, 0, &T::staticMetaObject,
279 
280  QDeclarativePrivate::attachedPropertiesFunc<T>(),
281  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
282 
286 
287  QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
288 
289  0,
290  0
291  };
292 
294 }
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterExtendedType() [2/2]

template<typename T , typename E >
int qmlRegisterExtendedType ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName 
)

Definition at line 297 of file qdeclarative.h.

299 {
300  QByteArray name(T::staticMetaObject.className());
301 
302  QByteArray pointerName(name + '*');
303  QByteArray listName("QDeclarativeListProperty<" + name + ">");
304 
305  QDeclarativeAttachedPropertiesFunc attached = QDeclarativePrivate::attachedPropertiesFunc<E>();
306  const QMetaObject * attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<E>();
307  if (!attached) {
308  attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
309  attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
310  }
311 
313  0,
314 
315  qRegisterMetaType<T *>(pointerName.constData()),
316  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
317  sizeof(T), QDeclarativePrivate::createInto<T>,
318  QString(),
319 
320  uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
321 
322  attached,
323  attachedMetaObject,
324 
328 
329  QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
330 
331  0,
332  0
333  };
334 
336 }
QObject *(* QDeclarativeAttachedPropertiesFunc)(QObject *)
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterInterface()

template<typename T >
int qmlRegisterInterface ( const char *  typeName)

Definition at line 339 of file qdeclarative.h.

340 {
342 
343  QByteArray pointerName(name + '*');
344  QByteArray listName("QDeclarativeListProperty<" + name + ">");
345 
347  0,
348 
349  qRegisterMetaType<T *>(pointerName.constData()),
350  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
351 
352  qobject_interface_iid<T *>()
353  };
354 
356 }
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 * typeName
Definition: qmetatype.cpp:239
const char * name
int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *)
The QDeclarativeListProperty class allows applications to expose list-like properties to QML...

◆ qmlRegisterRevision()

template<typename T , int metaObjectRevision>
int qmlRegisterRevision ( const char *  uri,
int  versionMajor,
int  versionMinor 
)

Definition at line 228 of file qdeclarative.h.

229 {
230  QByteArray name(T::staticMetaObject.className());
231 
232  QByteArray pointerName(name + '*');
233  QByteArray listName("QDeclarativeListProperty<" + name + ">");
234 
236  1,
237 
238  qRegisterMetaType<T *>(pointerName.constData()),
239  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
240  sizeof(T), QDeclarativePrivate::createInto<T>,
241  QString(),
242 
243  uri, versionMajor, versionMinor, 0, &T::staticMetaObject,
244 
245  QDeclarativePrivate::attachedPropertiesFunc<T>(),
246  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
247 
251 
252  0, 0,
253 
254  0,
255  metaObjectRevision
256  };
257 
259 }
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterType() [1/3]

template<typename T >
int qmlRegisterType ( )

Definition at line 90 of file qdeclarative.h.

91 {
92  QByteArray name(T::staticMetaObject.className());
93 
94  QByteArray pointerName(name + '*');
95  QByteArray listName("QDeclarativeListProperty<" + name + ">");
96 
98  0,
99 
100  qRegisterMetaType<T *>(pointerName.constData()),
101  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
102  0, 0,
103  QString(),
104 
105  0, 0, 0, 0, &T::staticMetaObject,
106 
107  QDeclarativePrivate::attachedPropertiesFunc<T>(),
108  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
109 
113 
114  0, 0,
115 
116  0,
117  0
118  };
119 
121 }
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterType() [2/3]

template<typename T >
int qmlRegisterType ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName 
)

Definition at line 160 of file qdeclarative.h.

161 {
162  QByteArray name(T::staticMetaObject.className());
163 
164  QByteArray pointerName(name + '*');
165  QByteArray listName("QDeclarativeListProperty<" + name + ">");
166 
168  0,
169 
170  qRegisterMetaType<T *>(pointerName.constData()),
171  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
172  sizeof(T), QDeclarativePrivate::createInto<T>,
173  QString(),
174 
175  uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
176 
177  QDeclarativePrivate::attachedPropertiesFunc<T>(),
178  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
179 
183 
184  0, 0,
185 
186  0,
187  0
188  };
189 
191 }
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterType() [3/3]

template<typename T , int metaObjectRevision>
int qmlRegisterType ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName 
)

Definition at line 194 of file qdeclarative.h.

195 {
196  QByteArray name(T::staticMetaObject.className());
197 
198  QByteArray pointerName(name + '*');
199  QByteArray listName("QDeclarativeListProperty<" + name + ">");
200 
202  1,
203 
204  qRegisterMetaType<T *>(pointerName.constData()),
205  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
206  sizeof(T), QDeclarativePrivate::createInto<T>,
207  QString(),
208 
209  uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
210 
211  QDeclarativePrivate::attachedPropertiesFunc<T>(),
212  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
213 
217 
218  0, 0,
219 
220  0,
221  metaObjectRevision
222  };
223 
225 }
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
The QString class provides a Unicode character string.
Definition: qstring.h:83
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...

◆ qmlRegisterTypeNotAvailable()

int Q_AUTOTEST_EXPORT qmlRegisterTypeNotAvailable ( const char *  uri,
int  versionMajor,
int  versionMinor,
const char *  qmlName,
const QString message 
)

Definition at line 46 of file qdeclarativetypenotavailable.cpp.

Referenced by QDeclarativeItemModule::defineModule(), QDeclarativeUtilModule::defineModule(), QDeclarativeItemModule::defineModuleCompat(), QDeclarativeUtilModule::defineModuleCompat(), and qmlRegisterType().

47 {
48  return qmlRegisterUncreatableType<QDeclarativeTypeNotAvailable>(uri,versionMajor,versionMinor,qmlName,message);
49 }

◆ qmlRegisterUncreatableType()

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

Definition at line 126 of file qdeclarative.h.

127 {
128  QByteArray name(T::staticMetaObject.className());
129 
130  QByteArray pointerName(name + '*');
131  QByteArray listName("QDeclarativeListProperty<" + name + ">");
132 
134  0,
135 
136  qRegisterMetaType<T *>(pointerName.constData()),
137  qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
138  0, 0,
139  reason,
140 
141  uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
142 
143  QDeclarativePrivate::attachedPropertiesFunc<T>(),
144  QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
145 
149 
150  0, 0,
151 
152  0,
153  0
154  };
155 
157 }
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...