diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-14 01:01:06 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-14 11:24:11 +0100 |
commit | 8a22c92b55b5d015e372fe5be0633c3935af4218 (patch) | |
tree | 02ad52cf1e7c3ed35b10156dd250d3cc7f6b7068 /src/quick/items | |
parent | 3ca659657ccaf0d850e661c9312e0f98e153c9ff (diff) | |
parent | 3dc5b937c4e9acf83ee54e870390c22f341c29c8 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
src/imports/folderlistmodel/plugin.cpp
src/imports/layouts/plugin.cpp
src/imports/localstorage/plugin.cpp
src/imports/models/plugin.cpp
src/imports/particles/plugin.cpp
src/imports/qtqml/plugin.cpp
src/imports/qtquick2/plugin.cpp
src/imports/shapes/plugin.cpp
src/imports/statemachine/plugin.cpp
src/imports/testlib/main.cpp
src/imports/wavefrontmesh/plugin.cpp
src/imports/window/plugin.cpp
src/imports/workerscript/plugin.cpp
src/qml/jsruntime/qv4sequenceobject.cpp
src/qml/qml/qqmlengine.cpp
src/qmlmodels/qqmlmodelsmodule.cpp
src/qmlmodels/qqmlmodelsmodule_p.h
src/qmlworkerscript/qqmlworkerscriptmodule.cpp
src/qmlworkerscript/qqmlworkerscriptmodule_p.h
src/quick/items/qquickitemsmodule.cpp
Change-Id: I5f1fbc3d00e8f583d2c89afc5389de84d68633a7
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 6 | ||||
-rw-r--r-- | src/quick/items/qquickimage.cpp | 8 | ||||
-rw-r--r-- | src/quick/items/qquickimage_p_p.h | 13 | ||||
-rw-r--r-- | src/quick/items/qquickitem_p.h | 2 | ||||
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 200 | ||||
-rw-r--r-- | src/quick/items/qquicklistview.cpp | 32 | ||||
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 6 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 2 |
8 files changed, 37 insertions, 232 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 338db5d66e..4615ce43d2 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -601,6 +601,10 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerScrollEvent : public QQuickSinglePoint Q_PROPERTY(bool hasPixelDelta READ hasPixelDelta CONSTANT) Q_PROPERTY(bool inverted READ isInverted CONSTANT) + QML_NAMED_ELEMENT(PointerScrollEvent) + QML_UNCREATABLE("PointerScrollEvent is only available via the WheelHandler::wheel signal.") + QML_ADDED_IN_MINOR_VERSION(14) + public: QQuickPointerScrollEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr) : QQuickSinglePointEvent(parent, device) { } diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index 840cfe15da..fccacdcce8 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -76,14 +76,8 @@ QSGTexture *QQuickImageTextureProvider::texture() const { } QQuickImagePrivate::QQuickImagePrivate() - : fillMode(QQuickImage::Stretch) - , paintedWidth(0) - , paintedHeight(0) - , pixmapChanged(false) + : pixmapChanged(false) , mipmap(false) - , hAlign(QQuickImage::AlignHCenter) - , vAlign(QQuickImage::AlignVCenter) - , provider(nullptr) { } diff --git a/src/quick/items/qquickimage_p_p.h b/src/quick/items/qquickimage_p_p.h index e2c467c311..1c4ba88655 100644 --- a/src/quick/items/qquickimage_p_p.h +++ b/src/quick/items/qquickimage_p_p.h @@ -80,19 +80,18 @@ class Q_QUICK_PRIVATE_EXPORT QQuickImagePrivate : public QQuickImageBasePrivate public: QQuickImagePrivate(); - - QQuickImage::FillMode fillMode; - qreal paintedWidth; - qreal paintedHeight; void setImage(const QImage &img); void setPixmap(const QQuickPixmap &pixmap); bool pixmapChanged : 1; bool mipmap : 1; - QQuickImage::HAlignment hAlign; - QQuickImage::VAlignment vAlign; + QQuickImage::HAlignment hAlign = QQuickImage::AlignHCenter; + QQuickImage::VAlignment vAlign = QQuickImage::AlignVCenter; + QQuickImage::FillMode fillMode = QQuickImage::Stretch; - QQuickImageTextureProvider *provider; + qreal paintedWidth = 0; + qreal paintedHeight = 0; + QQuickImageTextureProvider *provider = nullptr; }; QT_END_NAMESPACE diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index bc0d04c763..baef37a0ff 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -533,7 +533,7 @@ public: void refWindow(QQuickWindow *); void derefWindow(); - QQuickItem *subFocusItem; + QPointer<QQuickItem> subFocusItem; void updateSubFocusItem(QQuickItem *scope, bool focus); QTransform windowToItemTransform() const; diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index f7943630c4..f9b0a61b81 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -177,9 +177,6 @@ static QQmlPrivate::AutoParentResult qquickitem_autoParent(QObject *obj, QObject static void qt_quickitems_defineModule() { - const char *uri = "QtQuick"; - const int major = 2; - QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent); @@ -187,205 +184,12 @@ static void qt_quickitems_defineModule() qRegisterMetaType<QPointingDeviceUniqueId>("QPointingDeviceUniqueId"); qRegisterMetaType<QQuickHandlerPoint>(); - qmlRegisterModule(uri, major, 15); - - // Core QtQuick types - qmlRegisterTypesAndRevisions< - QPointingDeviceUniqueIdForeign, - QQuickAnchorAnimation, - QQuickAnchorChanges, - QQuickAnchors, - QQuickAnchorSet, - QQuickBorderImage, - QQuickEnterKeyAttached, - QQuickEventPoint, - QQuickEventTouchPoint, - QQuickFlickable, - QQuickFlickableVisibleArea, - QQuickFocusScope, - QQuickGradient, - QQuickGradientStop, - QQuickGraphicsInfo, - QQuickImage, - QQuickImageBase, - QQuickItem, - QQuickItemGrabResult, - QQuickKeyNavigationAttached, - QQuickKeysAttached, - QQuickLayoutMirroringAttached, - QQuickLoader, - QQuickMatrix4x4, - QQuickMouseArea, - QQuickMultiPointTouchArea, - QQuickPaintedItem, - QQuickParentAnimation, - QQuickParentChange, - QQuickPen, - QQuickPinch, - QQuickPinchArea, - QQuickPointerDevice, - QQuickRectangle, - QQuickRotation, - QQuickScale, - QQuickScaleGrid, - QQuickTouchPoint, - QQuickTransform, - QQuickTranslate - >(uri, major); - - // text-related types - qmlRegisterTypesAndRevisions< - QQuickText, - QQuickTextDocument, - QQuickTextEdit, - QQuickTextInput, - QQuickTextLine - >(uri, major); - - // events - qmlRegisterTypesAndRevisions< - QQuickCloseEvent, - QQuickGrabGestureEvent, - QQuickKeyEvent, - QQuickMouseEvent, - QQuickPinchEvent, - QQuickPointerEvent, - QQuickPointerMouseEvent, - QQuickPointerTouchEvent, - QQuickWheelEvent - >(uri, major); - - // Input Handlers are part of QtQuick, not a separate module, since 5.12 - qmlRegisterTypesAndRevisions< - QQuickDragHandler, - QQuickHoverHandler, - QQuickPinchHandler, - QQuickPointerHandler, - QQuickPointHandler, - QQuickTapHandler - >(uri, major); - -#if QT_CONFIG(accessibility) - qmlRegisterTypesAndRevisions<QQuickAccessibleAttached>(uri, major); -#endif - -#if QT_CONFIG(opengl) - qmlRegisterTypesAndRevisions<QQuickOpenGLInfo>(uri, major); -#endif - -#if QT_CONFIG(quick_animatedimage) - qmlRegisterTypesAndRevisions<QQuickAnimatedImage>(uri, major); -#else +#if !QT_CONFIG(quick_animatedimage) qmlRegisterTypeNotAvailable( - uri, major, 15, "AnimatedImage", + "QtQuick", 2, 15, "AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage", "Qt was built without support for QMovie")); #endif - -#if QT_CONFIG(quick_canvas) - qmlRegisterTypesAndRevisions<QQuickCanvasItem>(uri, major); -#endif - -#if QT_CONFIG(quick_draganddrop) - qmlRegisterTypesAndRevisions< - QQuickDropEvent, - QQuickDrag, - QQuickDropArea, - QQuickDropAreaDrag, - QQuickDragAttached, - QQuickDragAxis - >(uri, major); -#endif - -#if QT_CONFIG(quick_flipable) - qmlRegisterTypesAndRevisions<QQuickFlipable>(uri, major); -#endif - -#if QT_CONFIG(quick_positioners) - qmlRegisterTypesAndRevisions< - QQuickBasePositioner, - QQuickColumn, - QQuickFlow, - QQuickGrid, - QQuickRow - >(uri, major); -#endif - -#if QT_CONFIG(quick_gridview) - qmlRegisterTypesAndRevisions<QQuickGridView>(uri, major); -#endif - -#if QT_CONFIG(quick_itemview) - qmlRegisterTypesAndRevisions<QQuickItemView>(uri, major); -#endif - -#if QT_CONFIG(quick_listview) - qmlRegisterTypesAndRevisions< - QQuickViewSection, - QQuickListView - >(uri, major); -#endif - -#if QT_CONFIG(quick_path) - qmlRegisterTypesAndRevisions< - QQuickCurve, - QQuickPath, - QQuickPathAngleArc, - QQuickPathAnimation, - QQuickPathArc, - QQuickPathAttribute, - QQuickPathCatmullRomCurve, - QQuickPathCubic, - QQuickPathElement, - QQuickPathInterpolator, - QQuickPathLine, - QQuickPathMove, - QQuickPathMultiline, - QQuickPathPercent, - QQuickPathPolyline, - QQuickPathQuad, - QQuickPathSvg - >(uri, major); -#endif - -#if QT_CONFIG(quick_pathview) - qmlRegisterTypesAndRevisions<QQuickPathView>(uri, major); -#endif - -#if QT_CONFIG(quick_repeater) - qmlRegisterTypesAndRevisions<QQuickRepeater>(uri, major); -#endif - -#if QT_CONFIG(quick_shadereffect) - qmlRegisterTypesAndRevisions< - QQuickBorderImageMesh, - QQuickGridMesh, - QQuickItemLayer, - QQuickShaderEffect, - QQuickShaderEffectMesh, - QQuickShaderEffectSource - >(uri, major); -#endif - -#if QT_CONFIG(quick_sprite) - qmlRegisterTypesAndRevisions< - QQuickAnimatedSprite, - QQuickSprite, - QQuickSpriteSequence - >(uri, major); -#endif - -#if QT_CONFIG(quick_tableview) - qmlRegisterTypesAndRevisions<QQuickTableView>(uri, major); -#endif - -#if QT_CONFIG(quick_viewtransitions) - qmlRegisterTypesAndRevisions<QQuickViewTransitionAttached>(uri, major); -#endif - -#if QT_CONFIG(wheelevent) - qmlRegisterTypesAndRevisions<QQuickWheelHandler>(uri, major); -#endif } static void initResources() diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 1615c9ecea..badd2efe29 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -2710,21 +2710,25 @@ void QQuickListView::setSnapMode(SnapMode mode) This property determines the positioning of the \l{headerItem}{header item}. - The possible values are: - \list - \li ListView.InlineHeader (default) - the header is positioned in the beginning + \value ListView.InlineHeader (default) The header is positioned at the beginning of the content and moves together with the content like an ordinary item. - \li ListView.OverlayHeader - the header is positioned in the beginning of the view. - \li ListView.PullBackHeader - the header is positioned in the beginning of the view. + + \value ListView.OverlayHeader The header is positioned at the beginning of the view. + + \value ListView.PullBackHeader The header is positioned at the beginning of the view. The header can be pushed away by moving the content forwards, and pulled back by moving the content backwards. - \endlist \note This property has no effect on the \l {QQuickItem::z}{stacking order} of the header. For example, if the header should be shown above the \l delegate items when using \c ListView.OverlayHeader, its Z value should be set to a value higher than that of the delegates. For more information, see \l {Stacking Order in ListView}. + + \note If \c headerPositioning is not set to \c ListView.InlineHeader, the + user cannot press and flick the list from the header. In any case, the + \l{headerItem}{header item} may contain items or event handlers that + provide custom handling of mouse or touch input. */ QQuickListView::HeaderPositioning QQuickListView::headerPositioning() const { @@ -2753,21 +2757,25 @@ void QQuickListView::setHeaderPositioning(QQuickListView::HeaderPositioning posi This property determines the positioning of the \l{footerItem}{footer item}. - The possible values are: - \list - \li ListView.InlineFooter (default) - the footer is positioned in the end + \value ListView.InlineFooter (default) The footer is positioned at the end of the content and moves together with the content like an ordinary item. - \li ListView.OverlayFooter - the footer is positioned in the end of the view. - \li ListView.PullBackFooter - the footer is positioned in the end of the view. + + \value ListView.OverlayFooter The footer is positioned at the end of the view. + + \value ListView.PullBackFooter The footer is positioned at the end of the view. The footer can be pushed away by moving the content backwards, and pulled back by moving the content forwards. - \endlist \note This property has no effect on the \l {QQuickItem::z}{stacking order} of the footer. For example, if the footer should be shown above the \l delegate items when using \c ListView.OverlayFooter, its Z value should be set to a value higher than that of the delegates. For more information, see \l {Stacking Order in ListView}. + + \note If \c footerPositioning is not set to \c ListView.InlineFooter, the + user cannot press and flick the list from the footer. In any case, the + \l{footerItem}{footer item} may contain items or event handlers that + provide custom handling of mouse or touch input. */ QQuickListView::FooterPositioning QQuickListView::footerPositioning() const { diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 8c0512065a..2e7e07f705 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1074,11 +1074,7 @@ void QQuickTableViewPrivate::releaseItem(FxTableItem *fxTableItem, QQmlTableInst Q_TABLEVIEW_ASSERT(item, fxTableItem->index); delete item; } else if (item) { - // Only QQmlTableInstanceModel supports reusing items - auto releaseFlag = tableModel ? - tableModel->release(item, reusableFlag) : - model->release(item); - + auto releaseFlag = model->release(item, reusableFlag); if (releaseFlag == QQmlInstanceModel::Pooled) { fxTableItem->setVisible(false); diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index f674962a52..2eee98a738 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -4614,7 +4614,7 @@ QSGTexture *QQuickWindow::createTextureFromId(uint id, const QSize &size, Create \a nativeLayout is only used for APIs like Vulkan. When applicable, it must specify the current image layout, such as, a VkImageLayout value. - \sa sceneGraphInitialized(), QSGTexture + \sa sceneGraphInitialized(), QSGTexture, QSGTexture::nativeTexture() \since 5.14 */ |