diff options
Diffstat (limited to 'src/quick/items/qquickitemsmodule.cpp')
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 88 |
1 files changed, 80 insertions, 8 deletions
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 1bc1aebe4f..944f24c4ad 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -55,34 +55,56 @@ #include "qquickpincharea_p.h" #include "qquickflickable_p.h" #include "qquickflickable_p_p.h" +#if QT_CONFIG(quick_listview) #include "qquicklistview_p.h" +#endif +#if QT_CONFIG(quick_gridview) #include "qquickgridview_p.h" +#endif +#if QT_CONFIG(quick_pathview) #include "qquickpathview_p.h" +#endif +#if QT_CONFIG(quick_viewtransitions) #include "qquickitemviewtransition_p.h" +#endif +#if QT_CONFIG(quick_path) #include <private/qquickpath_p.h> #include <private/qquickpathinterpolator_p.h> +#endif +#if QT_CONFIG(quick_positioners) #include "qquickpositioners_p.h" +#endif #include "qquickrepeater_p.h" #include "qquickloader_p.h" +#if QT_CONFIG(quick_animatedimage) #include "qquickanimatedimage_p.h" +#endif +#if QT_CONFIG(quick_flipable) #include "qquickflipable_p.h" +#endif #include "qquicktranslate_p.h" #include "qquickstateoperations_p.h" #include "qquickitemanimation_p.h" -#include <QtQuick/private/qquickshadereffectsource_p.h> //#include <private/qquickpincharea_p.h> +#if QT_CONFIG(quick_canvas) #include <QtQuick/private/qquickcanvasitem_p.h> #include <QtQuick/private/qquickcontext2d_p.h> +#endif #include "qquickitemgrabresult.h" +#if QT_CONFIG(quick_sprite) #include "qquicksprite_p.h" #include "qquickspritesequence_p.h" #include "qquickanimatedsprite_p.h" +#endif #ifndef QT_NO_OPENGL # include "qquickopenglinfo_p.h" #endif #include "qquickgraphicsinfo_p.h" +#if QT_CONFIG(quick_shadereffect) +#include <QtQuick/private/qquickshadereffectsource_p.h> #include "qquickshadereffect_p.h" #include "qquickshadereffectmesh_p.h" +#endif #include "qquickdrag_p.h" #include "qquickdroparea_p.h" #include "qquickmultipointtoucharea_p.h" @@ -134,27 +156,40 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent); -#ifdef QT_NO_MOVIE +#if !QT_CONFIG(quick_animatedimage) qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie")); #else qmlRegisterType<QQuickAnimatedImage>(uri,major,minor,"AnimatedImage"); #endif qmlRegisterType<QQuickBorderImage>(uri,major,minor,"BorderImage"); - qmlRegisterType<QQuickColumn>(uri,major,minor,"Column"); qmlRegisterType<QQuickFlickable>(uri,major,minor,"Flickable"); +#if QT_CONFIG(quick_flipable) qmlRegisterType<QQuickFlipable>(uri,major,minor,"Flipable"); - qmlRegisterType<QQuickFlow>(uri,major,minor,"Flow"); +#endif // qmlRegisterType<QQuickFocusPanel>(uri,major,minor,"FocusPanel"); qmlRegisterType<QQuickFocusScope>(uri,major,minor,"FocusScope"); qmlRegisterType<QQuickGradient>(uri,major,minor,"Gradient"); qmlRegisterType<QQuickGradientStop>(uri,major,minor,"GradientStop"); +#if QT_CONFIG(quick_positioners) + qmlRegisterType<QQuickColumn>(uri,major,minor,"Column"); + qmlRegisterType<QQuickFlow>(uri,major,minor,"Flow"); qmlRegisterType<QQuickGrid>(uri,major,minor,"Grid"); + qmlRegisterUncreatableType<QQuickBasePositioner>(uri,major,minor,"Positioner", + QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); + qmlRegisterType<QQuickRow>(uri,major,minor,"Row"); +#endif +#if QT_CONFIG(quick_gridview) qmlRegisterType<QQuickGridView>(uri,major,minor,"GridView"); +#endif qmlRegisterType<QQuickImage>(uri,major,minor,"Image"); qmlRegisterType<QQuickItem>(uri,major,minor,"Item"); +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView>(uri,major,minor,"ListView"); + qmlRegisterType<QQuickViewSection>(uri,major,minor,"ViewSection"); +#endif qmlRegisterType<QQuickLoader>(uri,major,minor,"Loader"); qmlRegisterType<QQuickMouseArea>(uri,major,minor,"MouseArea"); +#if QT_CONFIG(quick_path) qmlRegisterType<QQuickPath>(uri,major,minor,"Path"); qmlRegisterType<QQuickPathAttribute>(uri,major,minor,"PathAttribute"); qmlRegisterType<QQuickPathCubic>(uri,major,minor,"PathCubic"); @@ -164,12 +199,12 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickPathCatmullRomCurve>("QtQuick",2,0,"PathCurve"); qmlRegisterType<QQuickPathArc>("QtQuick",2,0,"PathArc"); qmlRegisterType<QQuickPathSvg>("QtQuick",2,0,"PathSvg"); +#endif +#if QT_CONFIG(quick_pathview) qmlRegisterType<QQuickPathView>(uri,major,minor,"PathView"); - qmlRegisterUncreatableType<QQuickBasePositioner>(uri,major,minor,"Positioner", - QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); +#endif qmlRegisterType<QQuickRectangle>(uri,major,minor,"Rectangle"); qmlRegisterType<QQuickRepeater>(uri,major,minor,"Repeater"); - qmlRegisterType<QQuickRow>(uri,major,minor,"Row"); qmlRegisterType<QQuickTranslate>(uri,major,minor,"Translate"); qmlRegisterType<QQuickRotation>(uri,major,minor,"Rotation"); qmlRegisterType<QQuickScale>(uri,major,minor,"Scale"); @@ -180,17 +215,20 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickTextInput>(uri,major,minor,"TextInput"); qmlRegisterType<QQuickTextInput,2>(uri,2,2,"TextInput"); qmlRegisterType<QQuickTextInput,3>(uri,2,4,"TextInput"); - qmlRegisterType<QQuickViewSection>(uri,major,minor,"ViewSection"); qmlRegisterType<QQuickItemGrabResult>(); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickItemLayer>(); +#endif qmlRegisterType<QQuickAnchors>(); qmlRegisterType<QQuickKeyEvent>(); qmlRegisterType<QQuickMouseEvent>(); qmlRegisterType<QQuickWheelEvent>(); qmlRegisterType<QQuickCloseEvent>(); qmlRegisterType<QQuickTransform>(); +#if QT_CONFIG(quick_path) qmlRegisterType<QQuickPathElement>(); qmlRegisterType<QQuickCurve>(); +#endif qmlRegisterType<QQuickScaleGrid>(); qmlRegisterType<QQuickTextLine>(); qmlRegisterType<QQuickPen>(); @@ -203,32 +241,42 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterUncreatableType<QQuickKeyNavigationAttached>(uri,major,minor,"KeyNavigation",QQuickKeyNavigationAttached::tr("KeyNavigation is only available via attached properties")); qmlRegisterUncreatableType<QQuickKeysAttached>(uri,major,minor,"Keys",QQuickKeysAttached::tr("Keys is only available via attached properties")); qmlRegisterUncreatableType<QQuickLayoutMirroringAttached>(uri,major,minor,"LayoutMirroring", QQuickLayoutMirroringAttached::tr("LayoutMirroring is only available via attached properties")); +#if QT_CONFIG(quick_viewtransitions) qmlRegisterUncreatableType<QQuickViewTransitionAttached>(uri,major,minor,"ViewTransition",QQuickViewTransitionAttached::tr("ViewTransition is only available via attached properties")); +#endif qmlRegisterType<QQuickPinchArea>(uri,major,minor,"PinchArea"); qmlRegisterType<QQuickPinch>(uri,major,minor,"Pinch"); qmlRegisterType<QQuickPinchEvent>(); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickShaderEffectSource>("QtQuick", 2, 0, "ShaderEffectSource"); qmlRegisterUncreatableType<QQuickShaderEffectMesh>("QtQuick", 2, 0, "ShaderEffectMesh", QQuickShaderEffectMesh::tr("Cannot create instance of abstract class ShaderEffectMesh.")); qmlRegisterType<QQuickGridMesh>("QtQuick", 2, 0, "GridMesh"); qmlRegisterType<QQuickShaderEffect>("QtQuick", 2, 0, "ShaderEffect"); +#endif qmlRegisterUncreatableType<QQuickPaintedItem>("QtQuick", 2, 0, "PaintedItem", QQuickPaintedItem::tr("Cannot create instance of abstract class PaintedItem")); +#if QT_CONFIG(quick_canvas) qmlRegisterType<QQuickCanvasItem>("QtQuick", 2, 0, "Canvas"); +#endif +#if QT_CONFIG(quick_sprite) qmlRegisterType<QQuickSprite>("QtQuick", 2, 0, "Sprite"); qmlRegisterType<QQuickAnimatedSprite>("QtQuick", 2, 0, "AnimatedSprite"); qmlRegisterType<QQuickSpriteSequence>("QtQuick", 2, 0, "SpriteSequence"); +#endif qmlRegisterType<QQuickParentChange>(uri, major, minor,"ParentChange"); qmlRegisterType<QQuickAnchorChanges>(uri, major, minor,"AnchorChanges"); qmlRegisterType<QQuickAnchorSet>(); qmlRegisterType<QQuickAnchorAnimation>(uri, major, minor,"AnchorAnimation"); qmlRegisterType<QQuickParentAnimation>(uri, major, minor,"ParentAnimation"); +#if QT_CONFIG(quick_canvas) qmlRegisterType<QQuickPathAnimation>("QtQuick",2,0,"PathAnimation"); qmlRegisterType<QQuickPathInterpolator>("QtQuick",2,0,"PathInterpolator"); +#endif #ifndef QT_NO_DRAGANDDROP qmlRegisterType<QQuickDropArea>("QtQuick", 2, 0, "DropArea"); @@ -246,11 +294,19 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) #endif qmlRegisterType<QQuickItem, 1>(uri, 2, 1,"Item"); +#if QT_CONFIG(quick_positioners) qmlRegisterType<QQuickGrid, 1>(uri, 2, 1, "Grid"); +#endif +#if QT_CONFIG(quick_itemview) qmlRegisterUncreatableType<QQuickItemView, 1>(uri, 2, 1, "ItemView", QQuickItemView::tr("ItemView is an abstract base class")); qmlRegisterUncreatableType<QQuickItemView, 2>(uri, 2, 3, "ItemView", QQuickItemView::tr("ItemView is an abstract base class")); +#endif +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView, 1>(uri, 2, 1, "ListView"); +#endif +#if QT_CONFIG(quick_gridview) qmlRegisterType<QQuickGridView, 1>(uri, 2, 1, "GridView"); +#endif qmlRegisterType<QQuickTextEdit, 1>(uri, 2, 1, "TextEdit"); qmlRegisterType<QQuickText, 2>(uri, 2, 2, "Text"); @@ -261,9 +317,13 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickImage, 1>(uri, 2, 3,"Image"); qmlRegisterType<QQuickItem, 2>(uri, 2, 4, "Item"); +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView, 2>(uri, 2, 4, "ListView"); +#endif qmlRegisterType<QQuickMouseArea, 1>(uri, 2, 4, "MouseArea"); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickShaderEffect, 1>(uri, 2, 4, "ShaderEffect"); +#endif #ifndef QT_NO_OPENGL qmlRegisterUncreatableType<QQuickOpenGLInfo>(uri, 2, 4,"OpenGLInfo", QQuickOpenGLInfo::tr("OpenGLInfo is only available via attached properties")); @@ -275,26 +335,38 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) qmlRegisterType<QQuickText, 6>(uri, 2, 6, "Text"); qmlRegisterType<QQuickTextEdit, 6>(uri, 2, 6, "TextEdit"); qmlRegisterType<QQuickTextInput, 6>(uri, 2, 6, "TextInput"); +#if QT_CONFIG(quick_positioners) qmlRegisterUncreatableType<QQuickBasePositioner, 6>(uri, 2, 6, "Positioner", QStringLiteral("Positioner is an abstract type that is only available as an attached property.")); qmlRegisterType<QQuickColumn, 6>(uri, 2, 6, "Column"); qmlRegisterType<QQuickRow, 6>(uri, 2, 6, "Row"); qmlRegisterType<QQuickGrid, 6>(uri, 2, 6, "Grid"); qmlRegisterType<QQuickFlow, 6>(uri, 2, 6, "Flow"); +#endif qmlRegisterUncreatableType<QQuickEnterKeyAttached, 6>(uri, 2, 6, "EnterKey", QQuickEnterKeyAttached::tr("EnterKey is only available via attached properties")); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickShaderEffectSource, 1>(uri, 2, 6, "ShaderEffectSource"); +#endif +#if QT_CONFIG(quick_listview) qmlRegisterType<QQuickListView, 7>(uri, 2, 7, "ListView"); +#endif +#if QT_CONFIG(quick_gridview) qmlRegisterType<QQuickGridView, 7>(uri, 2, 7, "GridView"); +#endif qmlRegisterType<QQuickTextInput, 7>(uri, 2, 7, "TextInput"); qmlRegisterType<QQuickTextEdit, 7>(uri, 2, 7, "TextEdit"); +#if QT_CONFIG(quick_pathview) qmlRegisterType<QQuickPathView, 7>(uri, 2, 7, "PathView"); +#endif qmlRegisterUncreatableType<QQuickMouseEvent, 7>(uri, 2, 7, nullptr, QQuickMouseEvent::tr("MouseEvent is only available within handlers in MouseArea")); qmlRegisterUncreatableType<QQuickGraphicsInfo>(uri, 2, 8,"GraphicsInfo", QQuickGraphicsInfo::tr("GraphicsInfo is only available via attached properties")); +#if QT_CONFIG(quick_shadereffect) qmlRegisterType<QQuickBorderImageMesh>("QtQuick", 2, 8, "BorderImageMesh"); +#endif } static void initResources() |