diff -r 5dc02b23752f -r 3e2da88830cd src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp Tue Jul 06 15:10:48 2010 +0300 +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp Wed Aug 18 10:37:55 2010 +0300 @@ -79,8 +79,25 @@ #endif #include "private/qdeclarativeanchors_p.h" +static QDeclarativePrivate::AutoParentResult qgraphicsobject_autoParent(QObject *obj, QObject *parent) +{ + QGraphicsObject* gobj = qobject_cast(obj); + if (!gobj) + return QDeclarativePrivate::IncompatibleObject; + + QGraphicsObject* gparent = qobject_cast(parent); + if (!gparent) + return QDeclarativePrivate::IncompatibleParent; + + gobj->setParentItem(gparent); + return QDeclarativePrivate::Parented; +} + void QDeclarativeItemModule::defineModule() { + QDeclarativePrivate::RegisterAutoParent autoparent = { 0, &qgraphicsobject_autoParent }; + QDeclarativePrivate::qmlregister(QDeclarativePrivate::AutoParentRegistration, &autoparent); + #ifdef QT_NO_MOVIE qmlRegisterTypeNotAvailable("Qt",4,7,"AnimatedImage", qApp->translate("QDeclarativeAnimatedImage","Qt was built without support for QMovie")); @@ -112,9 +129,11 @@ qmlRegisterType("Qt",4,7,"PathPercent"); qmlRegisterType("Qt",4,7,"PathQuad"); qmlRegisterType("Qt",4,7,"PathView"); +#ifndef QT_NO_VALIDATOR qmlRegisterType("Qt",4,7,"IntValidator"); qmlRegisterType("Qt",4,7,"DoubleValidator"); qmlRegisterType("Qt",4,7,"RegExpValidator"); +#endif qmlRegisterType("Qt",4,7,"Rectangle"); qmlRegisterType("Qt",4,7,"Repeater"); qmlRegisterType("Qt",4,7,"Rotation"); @@ -138,9 +157,13 @@ qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); +#ifndef QT_NO_VALIDATOR qmlRegisterType(); +#endif qmlRegisterType(); +#ifndef QT_NO_ACTION qmlRegisterType(); +#endif qmlRegisterType(); qmlRegisterType(); #ifndef QT_NO_GRAPHICSEFFECT