42 #ifndef QDECLARATIVE_H 43 #define QDECLARATIVE_H 45 #include <QtDeclarative/qdeclarativeprivate.h> 46 #include <QtDeclarative/qdeclarativeparserstatus.h> 47 #include <QtDeclarative/qdeclarativepropertyvaluesource.h> 48 #include <QtDeclarative/qdeclarativepropertyvalueinterceptor.h> 49 #include <QtDeclarative/qdeclarativelist.h> 51 #include <QtCore/qbytearray.h> 52 #include <QtCore/qmetaobject.h> 56 #define QML_DECLARE_TYPE(TYPE) \ 57 Q_DECLARE_METATYPE(TYPE *) \ 58 Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>) 60 #define QML_DECLARE_TYPE_HASMETATYPE(TYPE) \ 61 Q_DECLARE_METATYPE(QDeclarativeListProperty<TYPE>) 63 #define QML_DECLARE_INTERFACE(INTERFACE) \ 64 QML_DECLARE_TYPE(INTERFACE) 66 #define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE) \ 67 QML_DECLARE_TYPE_HASMETATYPE(INTERFACE) 73 #define QML_DECLARE_TYPEINFO(TYPE, FLAGS) \ 76 class QDeclarativeTypeInfo<TYPE > \ 80 hasAttachedProperties = (((FLAGS) & QML_HAS_ATTACHED_PROPERTIES) == QML_HAS_ATTACHED_PROPERTIES) \ 95 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
100 qRegisterMetaType<T *>(pointerName.
constData()),
105 0, 0, 0, 0, &T::staticMetaObject,
107 QDeclarativePrivate::attachedPropertiesFunc<T>(),
108 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
131 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
136 qRegisterMetaType<T *>(pointerName.
constData()),
141 uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
143 QDeclarativePrivate::attachedPropertiesFunc<T>(),
144 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
160 int qmlRegisterType(
const char *uri,
int versionMajor,
int versionMinor,
const char *qmlName)
165 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
170 qRegisterMetaType<T *>(pointerName.
constData()),
172 sizeof(T), QDeclarativePrivate::createInto<T>,
175 uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
177 QDeclarativePrivate::attachedPropertiesFunc<T>(),
178 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
193 template<
typename T,
int metaObjectRevision>
194 int qmlRegisterType(
const char *uri,
int versionMajor,
int versionMinor,
const char *qmlName)
199 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
204 qRegisterMetaType<T *>(pointerName.
constData()),
206 sizeof(T), QDeclarativePrivate::createInto<T>,
209 uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
211 QDeclarativePrivate::attachedPropertiesFunc<T>(),
212 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
227 template<
typename T,
int metaObjectRevision>
233 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
238 qRegisterMetaType<T *>(pointerName.
constData()),
240 sizeof(T), QDeclarativePrivate::createInto<T>,
243 uri, versionMajor, versionMinor, 0, &T::staticMetaObject,
245 QDeclarativePrivate::attachedPropertiesFunc<T>(),
246 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
262 template<
typename T,
typename E>
268 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
273 qRegisterMetaType<T *>(pointerName.
constData()),
278 0, 0, 0, 0, &T::staticMetaObject,
280 QDeclarativePrivate::attachedPropertiesFunc<T>(),
281 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
287 QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
296 template<
typename T,
typename E>
303 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
306 const QMetaObject * attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<E>();
308 attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
309 attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
315 qRegisterMetaType<T *>(pointerName.
constData()),
317 sizeof(T), QDeclarativePrivate::createInto<T>,
320 uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
329 QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
344 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
349 qRegisterMetaType<T *>(pointerName.
constData()),
352 qobject_interface_iid<T *>()
365 QByteArray listName(
"QDeclarativeListProperty<" + name +
">");
370 qRegisterMetaType<T *>(pointerName.
constData()),
372 sizeof(T), QDeclarativePrivate::createInto<T>,
375 uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
377 QDeclarativePrivate::attachedPropertiesFunc<T>(),
378 QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
415 #endif // QDECLARATIVE_H The QVariant class acts like a union for the most common Qt data types.
QObject *(* QDeclarativeAttachedPropertiesFunc)(QObject *)
#define QT_END_NAMESPACE
This macro expands to.
#define QML_DECLARE_TYPE(TYPE)
int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, QDeclarativeCustomParser *parser)
The QByteArray class provides an array of bytes.
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
int Q_AUTOTEST_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString &message)
Q_DECLARATIVE_EXPORT QObject * qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create)
int qmlRegisterType(const char *url, const char *uri, int versionMajor, int versionMinor, const char *qmlName)
The QString class provides a Unicode character string.
int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor)
The QObject class is the base class of all Qt objects.
Q_DECLARATIVE_EXPORT QDeclarativeContext * qmlContext(const QObject *)
Q_DECLARATIVE_EXPORT QObject * qmlAttachedPropertiesObjectById(int, const QObject *, bool create=true)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *)
int qmlRegisterUncreatableType(const char *url, const char *uri, int versionMajor, int versionMinor, const char *qmlName)
int Q_DECLARATIVE_EXPORT qmlregister(RegistrationType, void *)
The QDeclarativeCustomParser class allows you to add new arbitrary types to QML.
const char * constData() const
Returns a pointer to the data stored in the byte array.
#define Q_DECLARATIVE_EXPORT
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
The QDeclarativeEngine class provides an environment for instantiating QML components.
#define Q_AUTOTEST_EXPORT
The QDeclarativeContext class defines a context within a QML engine.
int qmlRegisterExtendedType()
int qmlRegisterInterface(const char *typeName)
The QDeclarativeListProperty class allows applications to expose list-like properties to QML...