diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-03-25 02:09:59 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-03-25 02:12:54 (GMT) |
commit | a20828a110ad35a7a98a6234ca0013203d9f8b61 (patch) | |
tree | 9bb92d7cca2339465b79a6070584d2dca6e81c15 /src/declarative/util/qdeclarativeutilmodule.cpp | |
parent | 4d078ed668541a4051f91b5c120b8cb0534129bd (diff) | |
download | Qt-a20828a110ad35a7a98a6234ca0013203d9f8b61.zip Qt-a20828a110ad35a7a98a6234ca0013203d9f8b61.tar.gz Qt-a20828a110ad35a7a98a6234ca0013203d9f8b61.tar.bz2 |
Qt.Infinite -> Animation.Infinite
Too misleading to have on the Qt object, as it only means infinite
for animation loops.
Diffstat (limited to 'src/declarative/util/qdeclarativeutilmodule.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativeutilmodule.cpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp index 46c9b73..d79c6ba 100644 --- a/src/declarative/util/qdeclarativeutilmodule.cpp +++ b/src/declarative/util/qdeclarativeutilmodule.cpp @@ -71,6 +71,38 @@ #include "qdeclarativexmllistmodel_p.h" #endif +template<typename T> +int qmlRegisterTypeEnums(const char *qmlName) +{ + QByteArray name(T::staticMetaObject.className()); + + QByteArray pointerName(name + '*'); + QByteArray listName("QDeclarativeListProperty<" + name + ">"); + + QDeclarativePrivate::RegisterType type = { + 0, + + qRegisterMetaType<T *>(pointerName.constData()), + qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), + 0, 0, + + "Qt", 4, 6, qmlName, &T::staticMetaObject, + + QDeclarativePrivate::attachedPropertiesFunc<T>(), + QDeclarativePrivate::attachedPropertiesMetaObject<T>(), + + QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(), + QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(), + QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(), + + 0, 0, + + 0 + }; + + return QDeclarativePrivate::registerType(type); +} + void QDeclarativeUtilModule::defineModule() { qmlRegisterType<QDeclarativeAnchorAnimation>("Qt",4,6,"AnchorAnimation"); @@ -107,9 +139,10 @@ void QDeclarativeUtilModule::defineModule() #endif qmlRegisterType<QDeclarativeAnchors>(); - qmlRegisterType<QDeclarativeAbstractAnimation>(); qmlRegisterType<QDeclarativeStateOperation>(); + qmlRegisterTypeEnums<QDeclarativeAbstractAnimation>("Animation"); + qmlRegisterCustomType<QDeclarativeListModel>("Qt", 4,6, "ListModel", "QDeclarativeListModel", new QDeclarativeListModelParser); qmlRegisterCustomType<QDeclarativePropertyChanges>("Qt", 4, 6, "PropertyChanges", "QDeclarativePropertyChanges", |