aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/configure.json157
-rw-r--r--src/quick/designer/designer.pri6
-rw-r--r--src/quick/designer/qquickdesignercustomparserobject.cpp59
-rw-r--r--src/quick/designer/qquickdesignercustomparserobject_p.h68
-rw-r--r--src/quick/designer/qquickdesignersupport.cpp3
-rw-r--r--src/quick/designer/qquickdesignersupportmetainfo.cpp6
-rw-r--r--src/quick/designer/qquickdesignersupportmetainfo_p.h1
-rw-r--r--src/quick/doc/src/concepts/input/focus.qdoc12
-rw-r--r--src/quick/items/context2d/qquickcanvascontext_p.h5
-rw-r--r--src/quick/items/context2d/qquickcanvasitem_p.h4
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp100
-rw-r--r--src/quick/items/context2d/qquickcontext2d_p.h5
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp12
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture_p.h4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile_p.h4
-rw-r--r--src/quick/items/items.pri166
-rw-r--r--src/quick/items/qquickanimatedimage.cpp14
-rw-r--r--src/quick/items/qquickanimatedimage_p.h8
-rw-r--r--src/quick/items/qquickanimatedimage_p_p.h14
-rw-r--r--src/quick/items/qquickanimatedsprite.cpp32
-rw-r--r--src/quick/items/qquickanimatedsprite_p.h5
-rw-r--r--src/quick/items/qquickanimatedsprite_p_p.h4
-rw-r--r--src/quick/items/qquickborderimage.cpp13
-rw-r--r--src/quick/items/qquickborderimage_p.h2
-rw-r--r--src/quick/items/qquickborderimage_p_p.h6
-rw-r--r--src/quick/items/qquickevents.cpp9
-rw-r--r--src/quick/items/qquickflickable.cpp39
-rw-r--r--src/quick/items/qquickflickable_p.h2
-rw-r--r--src/quick/items/qquickflipable_p.h4
-rw-r--r--src/quick/items/qquickframebufferobject.cpp2
-rw-r--r--src/quick/items/qquickgridview_p.h5
-rw-r--r--src/quick/items/qquickitem.cpp69
-rw-r--r--src/quick/items/qquickitem.h2
-rw-r--r--src/quick/items/qquickitem_p.h13
-rw-r--r--src/quick/items/qquickitemanimation.cpp6
-rw-r--r--src/quick/items/qquickitemanimation_p.h6
-rw-r--r--src/quick/items/qquickitemanimation_p_p.h5
-rw-r--r--src/quick/items/qquickitemgrabresult.cpp4
-rw-r--r--src/quick/items/qquickitemsmodule.cpp88
-rw-r--r--src/quick/items/qquickitemview_p.h4
-rw-r--r--src/quick/items/qquickitemview_p_p.h4
-rw-r--r--src/quick/items/qquickitemviewtransition_p.h3
-rw-r--r--src/quick/items/qquicklistview.cpp2
-rw-r--r--src/quick/items/qquicklistview_p.h4
-rw-r--r--src/quick/items/qquickmousearea.cpp3
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp12
-rw-r--r--src/quick/items/qquickmultipointtoucharea_p.h2
-rw-r--r--src/quick/items/qquickopenglshadereffect_p.h4
-rw-r--r--src/quick/items/qquickopenglshadereffectnode_p.h4
-rw-r--r--src/quick/items/qquickpainteditem.cpp1
-rw-r--r--src/quick/items/qquickpathview_p.h4
-rw-r--r--src/quick/items/qquickpathview_p_p.h4
-rw-r--r--src/quick/items/qquickpositioners.cpp8
-rw-r--r--src/quick/items/qquickpositioners_p.h4
-rw-r--r--src/quick/items/qquickpositioners_p_p.h4
-rw-r--r--src/quick/items/qquickrectangle.cpp2
-rw-r--r--src/quick/items/qquickrendercontrol.cpp4
-rw-r--r--src/quick/items/qquickshadereffect_p.h4
-rw-r--r--src/quick/items/qquickshadereffectmesh.cpp2
-rw-r--r--src/quick/items/qquickshadereffectmesh_p.h4
-rw-r--r--src/quick/items/qquickshadereffectsource_p.h4
-rw-r--r--src/quick/items/qquicksprite_p.h5
-rw-r--r--src/quick/items/qquickspriteengine_p.h4
-rw-r--r--src/quick/items/qquickspritesequence_p.h4
-rw-r--r--src/quick/items/qquickspritesequence_p_p.h4
-rw-r--r--src/quick/items/qquicktext.cpp6
-rw-r--r--src/quick/items/qquickview.cpp26
-rw-r--r--src/quick/items/qquickview_p.h29
-rw-r--r--src/quick/items/qquickwindow.cpp55
-rw-r--r--src/quick/items/qquickwindowmodule.cpp8
-rw-r--r--src/quick/qtquickglobal.h4
-rw-r--r--src/quick/qtquickglobal_p.h4
-rw-r--r--src/quick/quick.pro11
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp4
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp8
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h4
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h2
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h4
-rw-r--r--src/quick/scenegraph/adaptations/software/software.pri9
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp73
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.h125
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp2
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer_p.h6
-rw-r--r--src/quick/scenegraph/qsgbasicinternalimagenode.cpp10
-rw-r--r--src/quick/scenegraph/qsgbasicinternalrectanglenode.cpp6
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp4
-rw-r--r--src/quick/scenegraph/qsgcontext_p.h2
-rw-r--r--src/quick/scenegraph/qsgdefaultcontext.cpp4
-rw-r--r--src/quick/scenegraph/qsgdefaultcontext_p.h2
-rw-r--r--src/quick/scenegraph/qsgdefaultrendercontext.cpp6
-rw-r--r--src/quick/scenegraph/qsgdefaultspritenode.cpp4
-rw-r--r--src/quick/scenegraph/qsgdefaultspritenode_p.h4
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp4
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp4
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp4
-rw-r--r--src/quick/scenegraph/scenegraph.pri9
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode.cpp16
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode_p.h2
-rw-r--r--src/quick/util/qquickanimator.cpp3
-rw-r--r--src/quick/util/qquickanimator_p.h5
-rw-r--r--src/quick/util/qquickanimatorjob.cpp8
-rw-r--r--src/quick/util/qquickfontloader.cpp16
-rw-r--r--src/quick/util/qquickimageprovider.cpp4
-rw-r--r--src/quick/util/qquickpath_p.h4
-rw-r--r--src/quick/util/qquickpath_p_p.h4
-rw-r--r--src/quick/util/qquickpathinterpolator_p.h4
-rw-r--r--src/quick/util/qquickpixmapcache.cpp27
-rw-r--r--src/quick/util/qquickutilmodule.cpp2
-rw-r--r--src/quick/util/util.pri15
114 files changed, 1199 insertions, 434 deletions
diff --git a/src/quick/configure.json b/src/quick/configure.json
new file mode 100644
index 0000000000..4ed11e8318
--- /dev/null
+++ b/src/quick/configure.json
@@ -0,0 +1,157 @@
+{
+ "module": "quick",
+ "depends": [
+ "qml-private",
+ "gui-private"
+ ],
+ "testDir": "../../config.tests",
+
+ "commandline": {
+ "options": {
+ "d3d12": "boolean",
+ "quick-animatedimage": "boolean",
+ "quick-canvas": "boolean",
+ "quick-designer": "boolean",
+ "quick-flipable": "boolean",
+ "quick-gridview": "boolean",
+ "quick-listview": "boolean",
+ "quick-path": "boolean",
+ "quick-pathview": "boolean",
+ "quick-positioners": "boolean",
+ "quick-shadereffect": "boolean",
+ "quick-sprite": "boolean"
+ }
+ },
+
+ "tests": {
+ "d3d12": {
+ "label": "Direct3D 12",
+ "type": "compile",
+ "test": "d3d12"
+ }
+ },
+
+ "features": {
+ "d3d12": {
+ "label": "Direct3D 12",
+ "purpose": "Provides a Direct3D 12 backend for the Qt Quick Scenegraph",
+ "condition": "tests.d3d12",
+ "output": [
+ "publicFeature"
+ ]
+ },
+ "quick-animatedimage": {
+ "label": "AnimatedImage item",
+ "purpose": "Provides the Qt Quick AnimatedImage Item",
+ "condition": "features.movie",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-canvas": {
+ "label": "Canvas item",
+ "purpose": "Provides the Qt Quick Canvas Item",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-designer": {
+ "label": "Support for Quick Designer",
+ "purpose": "Provides support for the Qt Quick Designer in Qt Creator",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-flipable": {
+ "label": "Flipable item",
+ "purpose": "Provides the Qt Quick Flipable Item",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-gridview": {
+ "label": "GridView item",
+ "purpose": "Provides the Qt Quick GridView item",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-itemview": {
+ "label": "ItemView item",
+ "condition": "features.quick-gridview || features.quick-listview",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-viewtransitions": {
+ "label": "Transitions required for ItemViews and Positioners",
+ "condition": "features.quick-itemview || features.quick-positioners",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-listview": {
+ "label": "ListView item",
+ "purpose": "Provides the Qt Quick ListView item",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-path": {
+ "label": "Path support",
+ "purpose": "Provides Path elements in Qt Quick",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-pathview": {
+ "label": "PathView item",
+ "purpose": "Provides the Qt Quick PathView item",
+ "condition": "features.quick-path",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-positioners": {
+ "label": "Positioner items",
+ "purpose": "Provides Positioner items in Qt Quick",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-shadereffect": {
+ "label": "ShaderEffect item",
+ "purpose": "Provides Shader effects in Qt Quick",
+ "output": [
+ "privateFeature"
+ ]
+ },
+ "quick-sprite": {
+ "label": "Sprite item",
+ "purpose": "Provides the Qt Quick Sprite Item",
+ "output": [
+ "privateFeature"
+ ]
+ }
+ },
+
+ "summary": [
+ {
+ "section": "Qt Quick",
+ "entries": [
+ "d3d12",
+ "quick-animatedimage",
+ "quick-canvas",
+ "quick-designer",
+ "quick-flipable",
+ "quick-gridview",
+ "quick-listview",
+ "quick-path",
+ "quick-pathview",
+ "quick-positioners",
+ "quick-shadereffect",
+ "quick-sprite"
+ ]
+ }
+ ]
+}
diff --git a/src/quick/designer/designer.pri b/src/quick/designer/designer.pri
index eb2141134d..f87ea4da04 100644
--- a/src/quick/designer/designer.pri
+++ b/src/quick/designer/designer.pri
@@ -7,7 +7,8 @@ HEADERS += \
designer/qquickdesignersupportproperties_p.h \
designer/qquickdesignersupportmetainfo_p.h \
designer/qqmldesignermetaobject_p.h \
- designer/qquickdesignersupport_p.h
+ designer/qquickdesignersupport_p.h \
+ designer/qquickdesignercustomparserobject_p.h
SOURCES += \
designer/qquickdesignercustomobjectdata.cpp \
@@ -18,4 +19,5 @@ SOURCES += \
designer/qquickdesignersupportpropertychanges.cpp \
designer/qquickdesignersupportstates.cpp \
designer/qquickdesignerwindowmanager.cpp \
- designer/qqmldesignermetaobject.cpp
+ designer/qqmldesignermetaobject.cpp \
+ designer/qquickdesignercustomparserobject.cpp
diff --git a/src/quick/designer/qquickdesignercustomparserobject.cpp b/src/quick/designer/qquickdesignercustomparserobject.cpp
new file mode 100644
index 0000000000..b785abe361
--- /dev/null
+++ b/src/quick/designer/qquickdesignercustomparserobject.cpp
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickdesignercustomparserobject_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQuickDesignerCustomParserObject::QQuickDesignerCustomParserObject()
+{
+
+}
+
+void QQuickDesignerCustomParser::verifyBindings(const QV4::CompiledData::Unit *, const QList<const QV4::CompiledData::Binding *> &)
+{
+ /* Nothing to do we accept anything */
+}
+
+void QQuickDesignerCustomParser::applyBindings(QObject *, QV4::CompiledData::CompilationUnit *, const QList<const QV4::CompiledData::Binding *> &)
+{
+ /* Nothing to do we accept anything */
+}
+
+QT_END_NAMESPACE
diff --git a/src/quick/designer/qquickdesignercustomparserobject_p.h b/src/quick/designer/qquickdesignercustomparserobject_p.h
new file mode 100644
index 0000000000..06206443b2
--- /dev/null
+++ b/src/quick/designer/qquickdesignercustomparserobject_p.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQuick module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QUICKDESIGNERCUSTOMPARSEROBJECT_H
+#define QUICKDESIGNERCUSTOMPARSEROBJECT_H
+
+#include <QObject>
+#include <private/qqmlcustomparser_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickDesignerCustomParserObject : public QObject
+{
+ Q_OBJECT
+
+public:
+ QQuickDesignerCustomParserObject();
+};
+
+class QQuickDesignerCustomParser : public QQmlCustomParser
+{
+public:
+ QQuickDesignerCustomParser()
+ : QQmlCustomParser(AcceptsAttachedProperties | AcceptsSignalHandlers) {}
+
+ void verifyBindings(const QV4::CompiledData::Unit *qmlUnit, const QList<const QV4::CompiledData::Binding *> &props) override;
+ void applyBindings(QObject *obj, QV4::CompiledData::CompilationUnit *compilationUnit, const QList<const QV4::CompiledData::Binding *> &bindings) override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QUICKDESIGNERCUSTOMPARSEROBJECT_H
diff --git a/src/quick/designer/qquickdesignersupport.cpp b/src/quick/designer/qquickdesignersupport.cpp
index 44be12bb78..3ff5a3ce96 100644
--- a/src/quick/designer/qquickdesignersupport.cpp
+++ b/src/quick/designer/qquickdesignersupport.cpp
@@ -40,7 +40,9 @@
#include "qquickdesignersupport_p.h"
#include <private/qquickitem_p.h>
+#if QT_CONFIG(quick_shadereffect)
#include <QtQuick/private/qquickshadereffectsource_p.h>
+#endif
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQml/private/qabstractanimationjob_p.h>
#include <private/qqmlengine_p.h>
@@ -51,6 +53,7 @@
#include <private/qqmlvme_p.h>
#include <private/qqmlcomponentattached_p.h>
#include <private/qqmldata_p.h>
+#include <private/qsgadaptationlayer_p.h>
#include "qquickdesignerwindowmanager_p.h"
diff --git a/src/quick/designer/qquickdesignersupportmetainfo.cpp b/src/quick/designer/qquickdesignersupportmetainfo.cpp
index 27c9814ef1..332ae26bd4 100644
--- a/src/quick/designer/qquickdesignersupportmetainfo.cpp
+++ b/src/quick/designer/qquickdesignersupportmetainfo.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include "qquickdesignercustomparserobject_p.h"
#include "qquickdesignersupportmetainfo_p.h"
#include "qqmldesignermetaobject_p.h"
@@ -70,5 +71,10 @@ void QQuickDesignerSupportMetaInfo::registerNotifyPropertyChangeCallBack(void (*
QQmlDesignerMetaObject::registerNotifyPropertyChangeCallBack(callback);
}
+void QQuickDesignerSupportMetaInfo::registerMockupObject(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
+{
+ qmlRegisterCustomType<QQuickDesignerCustomParserObject>(uri, versionMajor, versionMinor, qmlName, new QQuickDesignerCustomParser);
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/designer/qquickdesignersupportmetainfo_p.h b/src/quick/designer/qquickdesignersupportmetainfo_p.h
index 43cd8e8fb1..344d720d98 100644
--- a/src/quick/designer/qquickdesignersupportmetainfo_p.h
+++ b/src/quick/designer/qquickdesignersupportmetainfo_p.h
@@ -63,6 +63,7 @@ class Q_QUICK_EXPORT QQuickDesignerSupportMetaInfo
public:
static bool isSubclassOf(QObject *object, const QByteArray &superTypeName);
static void registerNotifyPropertyChangeCallBack(void (*callback)(QObject *, const QQuickDesignerSupport::PropertyName &));
+ static void registerMockupObject(const char *uri, int versionMajor, int versionMinor, const char *qmlName);
};
QT_END_NAMESPACE
diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc
index ec4e4ca2d9..fc1361f7ac 100644
--- a/src/quick/doc/src/concepts/input/focus.qdoc
+++ b/src/quick/doc/src/concepts/input/focus.qdoc
@@ -66,7 +66,7 @@ See also the \l {Keys}{Keys attached property} and \l {KeyNavigation}{KeyNavigat
\section1 Querying the Active Focus Item
Whether or not an \l Item has active focus can be queried through the
-property \c {Item::activeFocus} property. For example, here we have a \l Text
+\c {Item::activeFocus} property. For example, here we have a \l Text
type whose text is determined by whether or not it has active focus.
\snippet qml/focus/rectangle.qml active focus
@@ -98,17 +98,17 @@ The code that imports and creates two MyWidget instances:
The MyWidget code:
\snippet qml/focus/MyWidget.qml mywidget
-We would like to have the first MyWidget object to have the focus by setting its
+We want the first \c MyWidget object to have the focus, so we set its
\c focus property to \c true. However, by running the code, we can confirm that
the second widget receives the focus.
\image declarative-qmlfocus2.png
Looking at both \c MyWidget and \c window code, the problem is evident - there
-are three types that set the \c focus property set to \c true. The two
-MyWidget sets the \c focus to \c true and the \c window component also sets the
+are three types that set the \c focus property to \c true. The two
+\c {MyWidget}s set the \c focus to \c true and the \c window component also sets the
focus. Ultimately, only one type can have keyboard focus, and the system has
-to decide which type receives the focus. When the second MyWidget is created,
+to decide which type receives the focus. When the second \c MyWidget is created,
it receives the focus because it is the last type to set its \c focus
property to \c true.
@@ -190,7 +190,7 @@ print the name of the current list item.
\image declarative-qmlfocus5.png
-While the example is simple, there are a lot going on behind the scenes. Whenever
+While the example is simple, there is a lot going on behind the scenes. Whenever
the current item changes, the \l ListView sets the delegate's \c {Item::focus}
property. As the \l ListView is a focus scope, this doesn't affect the
rest of the application. However, if the \l ListView itself has
diff --git a/src/quick/items/context2d/qquickcanvascontext_p.h b/src/quick/items/context2d/qquickcanvascontext_p.h
index 4f71770e1a..0746b7dcd3 100644
--- a/src/quick/items/context2d/qquickcanvascontext_p.h
+++ b/src/quick/items/context2d/qquickcanvascontext_p.h
@@ -51,10 +51,13 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_canvas);
+
#include <QtQuick/qquickitem.h>
#include <private/qv8engine_p.h>
-
QT_BEGIN_NAMESPACE
class QQuickCanvasItem;
diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h
index 1948a57e58..8af84d0e7c 100644
--- a/src/quick/items/context2d/qquickcanvasitem_p.h
+++ b/src/quick/items/context2d/qquickcanvasitem_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_canvas);
+
#include <QtQuick/qquickitem.h>
#include <private/qv8engine_p.h>
#include <private/qqmlrefcount_p.h>
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index c26f641754..2483a8eadb 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -489,34 +489,43 @@ namespace QV4 {
namespace Heap {
struct QQuickJSContext2D : Object {
- QQuickJSContext2D() {}
+ void init() { Object::init(); }
QQuickContext2D* context;
};
struct QQuickJSContext2DPrototype : Object {
- QQuickJSContext2DPrototype() {}
+ void init() { Object::init(); }
};
struct QQuickContext2DStyle : Object {
- QQuickContext2DStyle()
+ void init()
{
+ brush = new QBrush;
patternRepeatX = false;
patternRepeatY = false;
}
+ void destroy() {
+ delete brush;
+ Object::destroy();
+ }
- QBrush brush;
+ QBrush *brush;
bool patternRepeatX:1;
bool patternRepeatY:1;
};
struct QQuickJSContext2DPixelData : Object {
- QQuickJSContext2DPixelData();
+ void init();
+ void destroy() {
+ delete image;
+ Object::destroy();
+ }
- QImage image;
+ QImage *image;
};
struct QQuickJSContext2DImageData : Object {
- QQuickJSContext2DImageData();
+ void init();
QV4::Value pixelData;
};
@@ -897,8 +906,10 @@ struct QQuickJSContext2DPixelData : public QV4::Object
static QV4::ReturnedValue proto_get_length(QV4::CallContext *ctx);
};
-QV4::Heap::QQuickJSContext2DPixelData::QQuickJSContext2DPixelData()
+void QV4::Heap::QQuickJSContext2DPixelData::init()
{
+ Object::init();
+ image = new QImage;
QV4::Scope scope(internalClass->engine);
QV4::ScopedObject o(scope, this);
o->setArrayType(QV4::Heap::ArrayData::Custom);
@@ -920,8 +931,9 @@ struct QQuickJSContext2DImageData : public QV4::Object
}
};
-QV4::Heap::QQuickJSContext2DImageData::QQuickJSContext2DImageData()
+void QV4::Heap::QQuickJSContext2DImageData::init()
{
+ Object::init();
pixelData = QV4::Primitive::undefinedValue();
QV4::Scope scope(internalClass->engine);
@@ -943,11 +955,11 @@ static QV4::ReturnedValue qt_create_image_data(qreal w, qreal h, QV4::ExecutionE
pixelData->setPrototype(p);
if (image.isNull()) {
- pixelData->d()->image = QImage(w, h, QImage::Format_ARGB32);
- pixelData->d()->image.fill(0x00000000);
+ *pixelData->d()->image = QImage(w, h, QImage::Format_ARGB32);
+ pixelData->d()->image->fill(0x00000000);
} else {
Q_ASSERT(image.width() == qRound(w) && image.height() == qRound(h));
- pixelData->d()->image = image.format() == QImage::Format_ARGB32 ? image : image.convertToFormat(QImage::Format_ARGB32);
+ *pixelData->d()->image = image.format() == QImage::Format_ARGB32 ? image : image.convertToFormat(QImage::Format_ARGB32);
}
QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, scope.engine->memoryManager->allocObject<QQuickJSContext2DImageData>());
@@ -1392,9 +1404,9 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_fillStyle(QV4::CallContext *ctx
r->d()->context->m_fillStyle.set(scope.engine, value);
} else {
QV4::Scoped<QQuickContext2DStyle> style(scope, value->as<QQuickContext2DStyle>());
- if (style && style->d()->brush != r->d()->context->state.fillStyle) {
- r->d()->context->state.fillStyle = style->d()->brush;
- r->d()->context->buffer()->setFillStyle(style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
+ if (style && *style->d()->brush != r->d()->context->state.fillStyle) {
+ r->d()->context->state.fillStyle = *style->d()->brush;
+ r->d()->context->buffer()->setFillStyle(*style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
r->d()->context->m_fillStyle.set(scope.engine, value);
r->d()->context->state.fillPatternRepeatX = style->d()->patternRepeatX;
r->d()->context->state.fillPatternRepeatY = style->d()->patternRepeatY;
@@ -1501,9 +1513,9 @@ QV4::ReturnedValue QQuickJSContext2D::method_set_strokeStyle(QV4::CallContext *c
r->d()->context->m_strokeStyle.set(scope.engine, value);
} else {
QV4::Scoped<QQuickContext2DStyle> style(scope, value->as<QQuickContext2DStyle>());
- if (style && style->d()->brush != r->d()->context->state.strokeStyle) {
- r->d()->context->state.strokeStyle = style->d()->brush;
- r->d()->context->buffer()->setStrokeStyle(style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
+ if (style && *style->d()->brush != r->d()->context->state.strokeStyle) {
+ r->d()->context->state.strokeStyle = *style->d()->brush;
+ r->d()->context->buffer()->setStrokeStyle(*style->d()->brush, style->d()->patternRepeatX, style->d()->patternRepeatY);
r->d()->context->m_strokeStyle.set(scope.engine, value);
r->d()->context->state.strokePatternRepeatX = style->d()->patternRepeatX;
r->d()->context->state.strokePatternRepeatY = style->d()->patternRepeatY;
@@ -1561,7 +1573,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createLinearGradient(QV4::
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
QV4::ScopedObject p(scope, ed->gradientProto.value());
gradient->setPrototype(p);
- gradient->d()->brush = QLinearGradient(x0, y0, x1, y1);
+ *gradient->d()->brush = QLinearGradient(x0, y0, x1, y1);
return gradient.asReturnedValue();
}
@@ -1612,7 +1624,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(QV4::
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
QV4::ScopedObject p(scope, ed->gradientProto.value());
gradient->setPrototype(p);
- gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r0+r1, QPointF(x0, y0));
+ *gradient->d()->brush = QRadialGradient(QPointF(x1, y1), r0+r1, QPointF(x0, y0));
return gradient.asReturnedValue();
}
@@ -1655,7 +1667,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createConicalGradient(QV4:
QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocObject<QQuickContext2DStyle>());
QV4::ScopedObject p(scope, ed->gradientProto.value());
gradient->setPrototype(p);
- gradient->d()->brush = QConicalGradient(x, y, angle);
+ *gradient->d()->brush = QConicalGradient(x, y, angle);
return gradient.asReturnedValue();
}
@@ -1720,7 +1732,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon
if (patternMode >= 0 && patternMode < Qt::LinearGradientPattern) {
style = static_cast<Qt::BrushStyle>(patternMode);
}
- pattern->d()->brush = QBrush(color, style);
+ *pattern->d()->brush = QBrush(color, style);
} else {
QImage patternTexture;
@@ -1728,14 +1740,14 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon
QV4::ScopedString s(scope, scope.engine->newString(QStringLiteral("data")));
QV4::Scoped<QQuickJSContext2DPixelData> pixelData(scope, o->get(s));
if (!!pixelData) {
- patternTexture = pixelData->d()->image;
+ patternTexture = *pixelData->d()->image;
}
} else {
patternTexture = r->d()->context->createPixmap(QUrl(ctx->args()[0].toQStringNoThrow()))->image();
}
if (!patternTexture.isNull()) {
- pattern->d()->brush.setTextureImage(patternTexture);
+ pattern->d()->brush->setTextureImage(patternTexture);
QString repetition = ctx->args()[1].toQStringNoThrow();
if (repetition == QLatin1String("repeat") || repetition.isEmpty()) {
@@ -2925,8 +2937,8 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_drawImage(QV4::CallContext
QV4::Scoped<QQuickJSContext2DImageData> imageData(scope, arg);
if (!!imageData) {
QV4::Scoped<QQuickJSContext2DPixelData> pix(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>());
- if (pix && !pix->d()->image.isNull()) {
- pixmap.adopt(new QQuickCanvasPixmap(pix->d()->image));
+ if (pix && !pix->d()->image->isNull()) {
+ pixmap.adopt(new QQuickCanvasPixmap(*pix->d()->image));
} else {
V4THROW_DOM(DOMEXCEPTION_TYPE_MISMATCH_ERR, "drawImage(), type mismatch");
}
@@ -3034,7 +3046,7 @@ QV4::ReturnedValue QQuickJSContext2DImageData::method_get_width(QV4::CallContext
QV4::Scoped<QQuickJSContext2DPixelData> r(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>());
if (!r)
return QV4::Encode(0);
- return QV4::Encode(r->d()->image.width());
+ return QV4::Encode(r->d()->image->width());
}
/*!
@@ -3050,7 +3062,7 @@ QV4::ReturnedValue QQuickJSContext2DImageData::method_get_height(QV4::CallContex
QV4::Scoped<QQuickJSContext2DPixelData> r(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>());
if (!r)
return QV4::Encode(0);
- return QV4::Encode(r->d()->image.height());
+ return QV4::Encode(r->d()->image->height());
}
/*!
@@ -3088,10 +3100,10 @@ QV4::ReturnedValue QQuickJSContext2DPixelData::proto_get_length(QV4::CallContext
{
QV4::Scope scope(ctx);
QV4::Scoped<QQuickJSContext2DPixelData> r(scope, ctx->thisObject().as<QQuickJSContext2DPixelData>());
- if (!r || r->d()->image.isNull())
+ if (!r || r->d()->image->isNull())
return QV4::Encode::undefined();
- return QV4::Encode(r->d()->image.width() * r->d()->image.height() * 4);
+ return QV4::Encode(r->d()->image->width() * r->d()->image->height() * 4);
}
QV4::ReturnedValue QQuickJSContext2DPixelData::getIndexed(const QV4::Managed *m, uint index, bool *hasProperty)
@@ -3101,13 +3113,13 @@ QV4::ReturnedValue QQuickJSContext2DPixelData::getIndexed(const QV4::Managed *m,
QV4::Scope scope(v4);
QV4::Scoped<QQuickJSContext2DPixelData> r(scope, static_cast<const QQuickJSContext2DPixelData *>(m));
- if (index < static_cast<quint32>(r->d()->image.width() * r->d()->image.height() * 4)) {
+ if (index < static_cast<quint32>(r->d()->image->width() * r->d()->image->height() * 4)) {
if (hasProperty)
*hasProperty = true;
- const quint32 w = r->d()->image.width();
+ const quint32 w = r->d()->image->width();
const quint32 row = (index / 4) / w;
const quint32 col = (index / 4) % w;
- const QRgb* pixel = reinterpret_cast<const QRgb*>(r->d()->image.constScanLine(row));
+ const QRgb* pixel = reinterpret_cast<const QRgb*>(r->d()->image->constScanLine(row));
pixel += col;
switch (index % 4) {
case 0:
@@ -3136,12 +3148,12 @@ void QQuickJSContext2DPixelData::putIndexed(QV4::Managed *m, uint index, const Q
QV4::Scoped<QQuickJSContext2DPixelData> r(scope, static_cast<QQuickJSContext2DPixelData *>(m));
const int v = value.toInt32();
- if (r && index < static_cast<quint32>(r->d()->image.width() * r->d()->image.height() * 4) && v >= 0 && v <= 255) {
- const quint32 w = r->d()->image.width();
+ if (r && index < static_cast<quint32>(r->d()->image->width() * r->d()->image->height() * 4) && v >= 0 && v <= 255) {
+ const quint32 w = r->d()->image->width();
const quint32 row = (index / 4) / w;
const quint32 col = (index / 4) % w;
- QRgb* pixel = reinterpret_cast<QRgb*>(r->d()->image.scanLine(row));
+ QRgb* pixel = reinterpret_cast<QRgb*>(r->d()->image->scanLine(row));
pixel += col;
switch (index % 4) {
case 0:
@@ -3192,8 +3204,8 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createImageData(QV4::CallC
if (!!imgData) {
QV4::Scoped<QQuickJSContext2DPixelData> pa(scope, imgData->d()->pixelData.as<QQuickJSContext2DPixelData>());
if (pa) {
- qreal w = pa->d()->image.width();
- qreal h = pa->d()->image.height();
+ qreal w = pa->d()->image->width();
+ qreal h = pa->d()->image->height();
return qt_create_image_data(w, h, scope.engine, QImage());
}
} else if (arg0->isString()) {
@@ -3271,8 +3283,8 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_putImageData(QV4::CallCont
QV4::Scoped<QQuickJSContext2DPixelData> pixelArray(scope, imageData->d()->pixelData.as<QQuickJSContext2DPixelData>());
if (pixelArray) {
- w = pixelArray->d()->image.width();
- h = pixelArray->d()->image.height();
+ w = pixelArray->d()->image->width();
+ h = pixelArray->d()->image->height();
if (ctx->argc() == 7) {
dirtyX = ctx->args()[3].toNumber();
@@ -3321,7 +3333,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_putImageData(QV4::CallCont
dirtyHeight = h;
}
- QImage image = pixelArray->d()->image.copy(dirtyX, dirtyY, dirtyWidth, dirtyHeight);
+ QImage image = pixelArray->d()->image->copy(dirtyX, dirtyY, dirtyWidth, dirtyHeight);
r->d()->context->buffer()->drawImage(image, QRectF(dirtyX, dirtyY, dirtyWidth, dirtyHeight), QRectF(dx, dy, dirtyWidth, dirtyHeight));
}
return ctx->thisObject().asReturnedValue();
@@ -3356,9 +3368,9 @@ QV4::ReturnedValue QQuickContext2DStyle::gradient_proto_addColorStop(QV4::CallCo
if (ctx->argc() == 2) {
- if (!style->d()->brush.gradient())
+ if (!style->d()->brush->gradient())
V4THROW_ERROR("Not a valid CanvasGradient object, can't get the gradient information");
- QGradient gradient = *(style->d()->brush.gradient());
+ QGradient gradient = *(style->d()->brush->gradient());
qreal pos = ctx->args()[0].toNumber();
QColor color;
@@ -3376,7 +3388,7 @@ QV4::ReturnedValue QQuickContext2DStyle::gradient_proto_addColorStop(QV4::CallCo
} else {
V4THROW_DOM(DOMEXCEPTION_SYNTAX_ERR, "CanvasGradient: parameter color is not a valid color string");
}
- style->d()->brush = gradient;
+ *style->d()->brush = gradient;
}
return ctx->thisObject().asReturnedValue();
diff --git a/src/quick/items/context2d/qquickcontext2d_p.h b/src/quick/items/context2d/qquickcontext2d_p.h
index 2e900a49af..334bf08329 100644
--- a/src/quick/items/context2d/qquickcontext2d_p.h
+++ b/src/quick/items/context2d/qquickcontext2d_p.h
@@ -51,7 +51,10 @@
// We mean it.
//
-#include <QtQuick/qtquickglobal.h>
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_canvas);
+
#include <QtQml/qqml.h>
#include <QtQml/qqmlcomponent.h>
#include <private/qquickcanvascontext_p.h>
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h
index 771f941564..2a1ac7304e 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_canvas);
+
#include <QtCore/qmutex.h>
#include "qquickcontext2d_p.h"
diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp
index ddecf7c3d4..4435c0c37b 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp
@@ -548,6 +548,9 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting()
{
QQuickContext2DTexture::beginPainting();
+ const qreal devicePixelRatio = (m_item && m_item->window()) ?
+ m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio();
+
if (m_canvasWindow.size().isEmpty()) {
delete m_fbo;
delete m_multisampledFbo;
@@ -562,7 +565,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting()
delete m_paint_device;
m_paint_device = 0;
- m_fboSize = npotAdjustedSize(m_canvasWindow.size());
+ m_fboSize = npotAdjustedSize(m_canvasWindow.size() * devicePixelRatio);
m_canvasWindowChanged = false;
if (doMultisampling()) {
@@ -600,6 +603,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting()
QOpenGLPaintDevice *gl_device = new QOpenGLPaintDevice(m_fbo->size());
gl_device->setPaintFlipped(true);
gl_device->setSize(m_fbo->size());
+ gl_device->setDevicePixelRatio(devicePixelRatio);
m_paint_device = gl_device;
}
@@ -705,8 +709,12 @@ QPaintDevice* QQuickContext2DImageTexture::beginPainting()
if (m_canvasWindow.size().isEmpty())
return 0;
+ const qreal devicePixelRatio = (m_item && m_item->window()) ?
+ m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio();
+
if (m_canvasWindowChanged) {
- m_image = QImage(m_canvasWindow.size(), QImage::Format_ARGB32_Premultiplied);
+ m_image = QImage(m_canvasWindow.size() * devicePixelRatio, QImage::Format_ARGB32_Premultiplied);
+ m_image.setDevicePixelRatio(devicePixelRatio);
m_image.fill(0x00000000);
m_canvasWindowChanged = false;
}
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h
index d7202ba68f..678e33826d 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_canvas);
+
#include <QtQuick/qsgtexture.h>
#include "qquickcanvasitem_p.h"
#include "qquickcontext2d_p.h"
diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h
index 160d51ec67..02238a882b 100644
--- a/src/quick/items/context2d/qquickcontext2dtile_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtile_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_canvas);
+
#include "qquickcontext2d_p.h"
#ifndef QT_NO_OPENGL
# include <QOpenGLFramebufferObject>
diff --git a/src/quick/items/items.pri b/src/quick/items/items.pri
index d91705451e..0f8061b5ef 100644
--- a/src/quick/items/items.pri
+++ b/src/quick/items/items.pri
@@ -41,19 +41,10 @@ HEADERS += \
$$PWD/qquickflickable_p.h \
$$PWD/qquickflickable_p_p.h \
$$PWD/qquickflickablebehavior_p.h \
- $$PWD/qquicklistview_p.h \
$$PWD/qquickrepeater_p.h \
$$PWD/qquickrepeater_p_p.h \
- $$PWD/qquickgridview_p.h \
- $$PWD/qquickpathview_p.h \
- $$PWD/qquickpathview_p_p.h \
- $$PWD/qquickpositioners_p.h \
- $$PWD/qquickpositioners_p_p.h \
$$PWD/qquickloader_p.h \
$$PWD/qquickloader_p_p.h \
- $$PWD/qquickanimatedimage_p.h \
- $$PWD/qquickanimatedimage_p_p.h \
- $$PWD/qquickflipable_p.h \
$$PWD/qquicktranslate_p.h \
$$PWD/qquickclipnode_p.h \
$$PWD/qquickview.h \
@@ -66,26 +57,13 @@ HEADERS += \
$$PWD/qquickdrag_p.h \
$$PWD/qquickdroparea_p.h \
$$PWD/qquickmultipointtoucharea_p.h \
- $$PWD/qquickitemview_p.h \
- $$PWD/qquickitemview_p_p.h \
- $$PWD/qquickitemviewtransition_p.h \
$$PWD/qquickscreen_p.h \
$$PWD/qquickwindowattached_p.h \
$$PWD/qquickwindowmodule_p.h \
- $$PWD/qquickshadereffectsource_p.h \
- $$PWD/qquickshadereffectmesh_p.h \
- $$PWD/qquickshadereffect_p.h \
- $$PWD/qquickgenericshadereffect_p.h \
$$PWD/qquickrendercontrol.h \
$$PWD/qquickrendercontrol_p.h \
$$PWD/qquickgraphicsinfo_p.h \
- $$PWD/qquickitemgrabresult.h \
- $$PWD/qquickspriteengine_p.h \
- $$PWD/qquicksprite_p.h \
- $$PWD/qquickspritesequence_p.h \
- $$PWD/qquickanimatedsprite_p.h \
- $$PWD/qquickanimatedsprite_p_p.h \
- $$PWD/qquickspritesequence_p_p.h
+ $$PWD/qquickitemgrabresult.h
SOURCES += \
$$PWD/qquickevents.cpp \
@@ -111,14 +89,8 @@ SOURCES += \
$$PWD/qquickmousearea.cpp \
$$PWD/qquickpincharea.cpp \
$$PWD/qquickflickable.cpp \
- $$PWD/qquicklistview.cpp \
$$PWD/qquickrepeater.cpp \
- $$PWD/qquickgridview.cpp \
- $$PWD/qquickpathview.cpp \
- $$PWD/qquickpositioners.cpp \
$$PWD/qquickloader.cpp \
- $$PWD/qquickanimatedimage.cpp \
- $$PWD/qquickflipable.cpp \
$$PWD/qquicktranslate.cpp \
$$PWD/qquickclipnode.cpp \
$$PWD/qquickview.cpp \
@@ -129,49 +101,133 @@ SOURCES += \
$$PWD/qquickdrag.cpp \
$$PWD/qquickdroparea.cpp \
$$PWD/qquickmultipointtoucharea.cpp \
- $$PWD/qquickitemview.cpp \
- $$PWD/qquickitemviewtransition.cpp \
$$PWD/qquickwindowmodule.cpp \
$$PWD/qquickscreen.cpp \
$$PWD/qquickwindowattached.cpp \
- $$PWD/qquickshadereffectsource.cpp \
- $$PWD/qquickshadereffectmesh.cpp \
- $$PWD/qquickshadereffect.cpp \
- $$PWD/qquickgenericshadereffect.cpp \
$$PWD/qquickrendercontrol.cpp \
$$PWD/qquickgraphicsinfo.cpp \
- $$PWD/qquickitemgrabresult.cpp \
- $$PWD/qquickspriteengine.cpp \
- $$PWD/qquicksprite.cpp \
- $$PWD/qquickspritesequence.cpp \
- $$PWD/qquickanimatedsprite.cpp
+ $$PWD/qquickitemgrabresult.cpp
+
+qtConfig(quick-animatedimage) {
+ HEADERS += \
+ $$PWD/qquickanimatedimage_p.h \
+ $$PWD/qquickanimatedimage_p_p.h
+ SOURCES += \
+ $$PWD/qquickanimatedimage.cpp
+}
+
+qtConfig(quick-gridview) {
+ HEADERS += \
+ $$PWD/qquickgridview_p.h
+ SOURCES += \
+ $$PWD/qquickgridview.cpp
+}
+
+qtConfig(quick-itemview) {
+ HEADERS += \
+ $$PWD/qquickitemview_p.h \
+ $$PWD/qquickitemview_p_p.h
+ SOURCES += \
+ $$PWD/qquickitemview.cpp
+}
+
+qtConfig(quick-viewtransitions) {
+ HEADERS += \
+ $$PWD/qquickitemviewtransition_p.h
+ SOURCES += \
+ $$PWD/qquickitemviewtransition.cpp
+}
+
+qtConfig(quick-listview) {
+ HEADERS += \
+ $$PWD/qquicklistview_p.h
+ SOURCES += \
+ $$PWD/qquicklistview.cpp
+}
+
+qtConfig(quick-pathview) {
+ HEADERS += \
+ $$PWD/qquickpathview_p.h \
+ $$PWD/qquickpathview_p_p.h
+ SOURCES += \
+ $$PWD/qquickpathview.cpp
+}
+
+qtConfig(quick-positioners) {
+ HEADERS += \
+ $$PWD/qquickpositioners_p.h \
+ $$PWD/qquickpositioners_p_p.h
+ SOURCES += \
+ $$PWD/qquickpositioners.cpp
+}
+
+qtConfig(quick-flipable) {
+ HEADERS += \
+ $$PWD/qquickflipable_p.h
+ SOURCES += \
+ $$PWD/qquickflipable.cpp
+}
+
+qtConfig(quick-shadereffect) {
+ HEADERS += \
+ $$PWD/qquickshadereffectsource_p.h \
+ $$PWD/qquickshadereffectmesh_p.h \
+ $$PWD/qquickshadereffect_p.h \
+ $$PWD/qquickgenericshadereffect_p.h
+ SOURCES += \
+ $$PWD/qquickshadereffectsource.cpp \
+ $$PWD/qquickshadereffectmesh.cpp \
+ $$PWD/qquickshadereffect.cpp \
+ $$PWD/qquickgenericshadereffect.cpp
+
+ qtConfig(opengl) {
+ SOURCES += \
+ $$PWD/qquickopenglshadereffect.cpp \
+ $$PWD/qquickopenglshadereffectnode.cpp
+ HEADERS += \
+ $$PWD/qquickopenglshadereffect_p.h \
+ $$PWD/qquickopenglshadereffectnode_p.h
+
+ OTHER_FILES += \
+ $$PWD/shaders/shadereffect.vert \
+ $$PWD/shaders/shadereffect.frag \
+ $$PWD/shaders/shadereffectfallback.vert \
+ $$PWD/shaders/shadereffectfallback.frag \
+ $$PWD/shaders/shadereffect_core.vert \
+ $$PWD/shaders/shadereffect_core.frag \
+ $$PWD/shaders/shadereffectfallback_core.vert \
+ $$PWD/shaders/shadereffectfallback_core.frag
+ }
+}
+
+qtConfig(quick-sprite) {
+ HEADERS += \
+ $$PWD/qquickspriteengine_p.h \
+ $$PWD/qquicksprite_p.h \
+ $$PWD/qquickspritesequence_p.h \
+ $$PWD/qquickanimatedsprite_p.h \
+ $$PWD/qquickanimatedsprite_p_p.h \
+ $$PWD/qquickspritesequence_p_p.h
+ SOURCES += \
+ $$PWD/qquickspriteengine.cpp \
+ $$PWD/qquicksprite.cpp \
+ $$PWD/qquickspritesequence.cpp \
+ $$PWD/qquickanimatedsprite.cpp
+}
# Items that depend on OpenGL Renderer
qtConfig(opengl(es1|es2)?) {
SOURCES += \
$$PWD/qquickopenglinfo.cpp \
- $$PWD/qquickopenglshadereffect.cpp \
- $$PWD/qquickopenglshadereffectnode.cpp \
$$PWD/qquickframebufferobject.cpp
HEADERS += \
$$PWD/qquickopenglinfo_p.h \
- $$PWD/qquickopenglshadereffect_p.h \
- $$PWD/qquickopenglshadereffectnode_p.h \
$$PWD/qquickframebufferobject.h
-
- OTHER_FILES += \
- $$PWD/shaders/shadereffect.vert \
- $$PWD/shaders/shadereffect.frag \
- $$PWD/shaders/shadereffectfallback.vert \
- $$PWD/shaders/shadereffectfallback.frag \
- $$PWD/shaders/shadereffect_core.vert \
- $$PWD/shaders/shadereffect_core.frag \
- $$PWD/shaders/shadereffectfallback_core.vert \
- $$PWD/shaders/shadereffectfallback_core.frag
}
RESOURCES += \
$$PWD/items.qrc
-include(context2d/context2d.pri)
+qtConfig(quick-canvas): \
+ include(context2d/context2d.pri)
diff --git a/src/quick/items/qquickanimatedimage.cpp b/src/quick/items/qquickanimatedimage.cpp
index 6f14bf15fe..81c649dbd5 100644
--- a/src/quick/items/qquickanimatedimage.cpp
+++ b/src/quick/items/qquickanimatedimage.cpp
@@ -40,14 +40,12 @@
#include "qquickanimatedimage_p.h"
#include "qquickanimatedimage_p_p.h"
-#ifndef QT_NO_MOVIE
-
#include <QtGui/qguiapplication.h>
#include <QtQml/qqmlinfo.h>
#include <QtQml/qqmlfile.h>
#include <QtQml/qqmlengine.h>
#include <QtGui/qmovie.h>
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkreply.h>
#endif
@@ -146,7 +144,7 @@ QQuickAnimatedImage::QQuickAnimatedImage(QQuickItem *parent)
QQuickAnimatedImage::~QQuickAnimatedImage()
{
Q_D(QQuickAnimatedImage);
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
if (d->reply)
d->reply->deleteLater();
#endif
@@ -268,7 +266,7 @@ void QQuickAnimatedImage::setSource(const QUrl &url)
if (url == d->url)
return;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
if (d->reply) {
d->reply->deleteLater();
d->reply = 0;
@@ -325,7 +323,7 @@ void QQuickAnimatedImage::load()
d->_movie = new QMovie(lf);
movieRequestFinished();
} else {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
if (d->status != Loading) {
d->status = Loading;
emit statusChanged(d->status);
@@ -354,7 +352,7 @@ void QQuickAnimatedImage::movieRequestFinished()
Q_D(QQuickAnimatedImage);
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
if (d->reply) {
d->redirectCount++;
if (d->redirectCount < ANIMATEDIMAGE_MAXIMUM_REDIRECT_RECURSION) {
@@ -493,5 +491,3 @@ void QQuickAnimatedImage::componentComplete()
}
QT_END_NAMESPACE
-
-#endif // QT_NO_MOVIE
diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h
index 288a8379da..143fe8904d 100644
--- a/src/quick/items/qquickanimatedimage_p.h
+++ b/src/quick/items/qquickanimatedimage_p.h
@@ -51,9 +51,11 @@
// We mean it.
//
-#include "qquickimage_p.h"
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_animatedimage);
-#ifndef QT_NO_MOVIE
+#include "qquickimage_p.h"
QT_BEGIN_NAMESPACE
@@ -116,6 +118,4 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAnimatedImage)
-#endif // QT_NO_MOVIE
-
#endif // QQUICKANIMATEDIMAGE_P_H
diff --git a/src/quick/items/qquickanimatedimage_p_p.h b/src/quick/items/qquickanimatedimage_p_p.h
index ed735d1c9c..9eff6a44e3 100644
--- a/src/quick/items/qquickanimatedimage_p_p.h
+++ b/src/quick/items/qquickanimatedimage_p_p.h
@@ -51,14 +51,16 @@
// We mean it.
//
-#include "qquickimage_p_p.h"
+#include <QtQuick/qtquickglobal.h>
+
+QT_REQUIRE_CONFIG(quick_animatedimage);
-#ifndef QT_NO_MOVIE
+#include "qquickimage_p_p.h"
QT_BEGIN_NAMESPACE
class QMovie;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
class QNetworkReply;
#endif
@@ -69,7 +71,7 @@ class QQuickAnimatedImagePrivate : public QQuickImagePrivate
public:
QQuickAnimatedImagePrivate()
: playing(true), paused(false), preset_currentframe(0), _movie(0), oldPlaying(false)
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
, reply(0), redirectCount(0)
#endif
, currentSourceSize(0, 0)
@@ -83,7 +85,7 @@ public:
int preset_currentframe;
QMovie *_movie;
bool oldPlaying;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QNetworkReply *reply;
int redirectCount;
#endif
@@ -93,6 +95,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_MOVIE
-
#endif // QQUICKANIMATEDIMAGE_P_P_H
diff --git a/src/quick/items/qquickanimatedsprite.cpp b/src/quick/items/qquickanimatedsprite.cpp
index 991ca8519f..8aeef4ef4a 100644
--- a/src/quick/items/qquickanimatedsprite.cpp
+++ b/src/quick/items/qquickanimatedsprite.cpp
@@ -42,6 +42,7 @@
#include "qquicksprite_p.h"
#include "qquickspriteengine_p.h"
#include <QtQuick/private/qsgcontext_p.h>
+#include <QtQuick/private/qquickitem_p.h>
#include <private/qsgadaptationlayer_p.h>
#include <private/qqmlglobal_p.h>
#include <QtQuick/qsgnode.h>
@@ -349,7 +350,7 @@ void QQuickAnimatedSprite::start()
}
emit currentFrameChanged(0);
emit runningChanged(true);
- update();
+ maybeUpdate();
}
void QQuickAnimatedSprite::stop()
@@ -360,7 +361,7 @@ void QQuickAnimatedSprite::stop()
return;
d->m_pauseOffset = 0;
emit runningChanged(false);
- update();
+ maybeUpdate();
}
/*!
@@ -379,7 +380,15 @@ void QQuickAnimatedSprite::advance(int frames)
d->m_curFrame += d->m_spriteEngine->maxFrames();
d->m_curFrame = d->m_curFrame % d->m_spriteEngine->maxFrames();
emit currentFrameChanged(d->m_curFrame);
- update();
+ maybeUpdate();
+}
+
+void QQuickAnimatedSprite::maybeUpdate()
+{
+ QQuickItemPrivate *priv = QQuickItemPrivate::get(this);
+ const QLazilyAllocated<QQuickItemPrivate::ExtraData> &extraData = priv->extra;
+ if ((extraData.isAllocated() && extraData->effectRefCount > 0) || priv->effectiveVisible)
+ update();
}
/*!
@@ -399,7 +408,7 @@ void QQuickAnimatedSprite::pause()
d->m_pauseOffset = d->m_timestamp.elapsed();
d->m_paused = true;
emit pausedChanged(true);
- update();
+ maybeUpdate();
}
/*!
@@ -419,7 +428,7 @@ void QQuickAnimatedSprite::resume()
d->m_pauseOffset = d->m_pauseOffset - d->m_timestamp.elapsed();
d->m_paused = false;
emit pausedChanged(false);
- update();
+ maybeUpdate();
}
void QQuickAnimatedSprite::setRunning(bool arg)
@@ -610,7 +619,6 @@ void QQuickAnimatedSprite::createEngine()
d->m_spriteEngine = new QQuickSpriteEngine(QList<QQuickSprite*>(spriteList), this);
d->m_spriteEngine->startAssemblingImage();
reset();
- update();
}
QSGSpriteNode* QQuickAnimatedSprite::initNode()
@@ -622,10 +630,10 @@ QSGSpriteNode* QQuickAnimatedSprite::initNode()
return nullptr;
} else if (d->m_spriteEngine->status() == QQuickPixmap::Null) {
d->m_spriteEngine->startAssemblingImage();
- update();//Schedule another update, where we will check again
+ maybeUpdate();//Schedule another update, where we will check again
return nullptr;
} else if (d->m_spriteEngine->status() == QQuickPixmap::Loading) {
- update();//Schedule another update, where we will check again
+ maybeUpdate();//Schedule another update, where we will check again
return nullptr;
}
@@ -651,7 +659,7 @@ void QQuickAnimatedSprite::reset()
{
Q_D(QQuickAnimatedSprite);
d->m_pleaseReset = true;
- update();
+ maybeUpdate();
}
QSGNode *QQuickAnimatedSprite::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
@@ -673,7 +681,7 @@ QSGNode *QQuickAnimatedSprite::updatePaintNode(QSGNode *oldNode, UpdatePaintNode
prepareNextFrame(node);
if (d->m_running && !d->m_paused)
- update();
+ maybeUpdate();
return node;
}
@@ -726,7 +734,7 @@ void QQuickAnimatedSprite::prepareNextFrame(QSGSpriteNode *node)
frameAt = 0;
d->m_running = false;
emit runningChanged(false);
- update();
+ maybeUpdate();
}
} else {
frameAt = d->m_curFrame;
@@ -734,7 +742,7 @@ void QQuickAnimatedSprite::prepareNextFrame(QSGSpriteNode *node)
if (d->m_curFrame != lastFrame) {
if (isCurrentFrameChangedConnected())
emit currentFrameChanged(d->m_curFrame);
- update();
+ maybeUpdate();
}
qreal frameCount = d->m_spriteEngine->spriteFrames();
diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h
index cbd6524c40..850461a011 100644
--- a/src/quick/items/qquickanimatedsprite_p.h
+++ b/src/quick/items/qquickanimatedsprite_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include <QtQuick/QQuickItem>
#include <private/qquicksprite_p.h>
#include <QtCore/qelapsedtimer.h>
@@ -168,6 +172,7 @@ protected:
void componentComplete() Q_DECL_OVERRIDE;
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE;
private:
+ void maybeUpdate();
bool isCurrentFrameChangedConnected();
void prepareNextFrame(QSGSpriteNode *node);
void reloadImage();
diff --git a/src/quick/items/qquickanimatedsprite_p_p.h b/src/quick/items/qquickanimatedsprite_p_p.h
index 0e4a1e9066..3610e58861 100644
--- a/src/quick/items/qquickanimatedsprite_p_p.h
+++ b/src/quick/items/qquickanimatedsprite_p_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <QtQuick/qtquickglobal.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include "qquickitem_p.h"
#include "qquicksprite_p.h"
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp
index ca5ad8dbbd..67b99bfbc6 100644
--- a/src/quick/items/qquickborderimage.cpp
+++ b/src/quick/items/qquickborderimage.cpp
@@ -43,7 +43,7 @@
#include <QtQml/qqmlinfo.h>
#include <QtQml/qqmlfile.h>
#include <QtQml/qqmlengine.h>
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
#include <QtNetwork/qnetworkreply.h>
#endif
#include <QtCore/qfile.h>
@@ -51,6 +51,7 @@
#include <QtGui/qguiapplication.h>
#include <private/qqmlglobal_p.h>
+#include <private/qsgadaptationlayer_p.h>
QT_BEGIN_NAMESPACE
@@ -171,7 +172,7 @@ QQuickBorderImage::QQuickBorderImage(QQuickItem *parent)
QQuickBorderImage::~QQuickBorderImage()
{
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
Q_D(QQuickBorderImage);
if (d->sciReply)
d->sciReply->deleteLater();
@@ -274,7 +275,7 @@ void QQuickBorderImage::setSource(const QUrl &url)
if (url == d->url)
return;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
if (d->sciReply) {
d->sciReply->deleteLater();
d->sciReply = 0;
@@ -317,7 +318,7 @@ void QQuickBorderImage::load()
setGridScaledImage(QQuickGridScaledImage(&file));
return;
} else {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
if (d->progress != 0.0) {
d->progress = 0.0;
emit progressChanged(d->progress);
@@ -537,7 +538,7 @@ void QQuickBorderImage::requestFinished()
pixmapChange();
}
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
#define BORDERIMAGE_MAX_REDIRECT 16
void QQuickBorderImage::sciRequestFinished()
@@ -567,7 +568,7 @@ void QQuickBorderImage::sciRequestFinished()
setGridScaledImage(sci);
}
}
-#endif // QT_NO_NETWORK
+#endif // qml_network
void QQuickBorderImage::doUpdate()
{
diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h
index f2764660f6..844f71e2c9 100644
--- a/src/quick/items/qquickborderimage_p.h
+++ b/src/quick/items/qquickborderimage_p.h
@@ -101,7 +101,7 @@ private:
private Q_SLOTS:
void doUpdate();
void requestFinished() Q_DECL_OVERRIDE;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
void sciRequestFinished();
#endif
diff --git a/src/quick/items/qquickborderimage_p_p.h b/src/quick/items/qquickborderimage_p_p.h
index 56fbbab049..0f4e7acc05 100644
--- a/src/quick/items/qquickborderimage_p_p.h
+++ b/src/quick/items/qquickborderimage_p_p.h
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
class QNetworkReply;
#endif
class QQuickBorderImagePrivate : public QQuickImageBasePrivate
@@ -69,7 +69,7 @@ public:
QQuickBorderImagePrivate()
: border(0), horizontalTileMode(QQuickBorderImage::Stretch),
verticalTileMode(QQuickBorderImage::Stretch), pixmapChanged(false)
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
, sciReply(0), redirectCount(0)
#endif
{
@@ -108,7 +108,7 @@ public:
QQuickBorderImage::TileMode verticalTileMode;
bool pixmapChanged : 1;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QNetworkReply *sciReply;
int redirectCount;
#endif
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 86d1ddac6c..2fad9f5a8d 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -46,6 +46,7 @@
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcPointerEvents, "qt.quick.pointer.events")
+Q_LOGGING_CATEGORY(lcPointerGrab, "qt.quick.pointer.grab")
/*!
\qmltype KeyEvent
@@ -523,6 +524,14 @@ QQuickItem *QQuickEventPoint::grabber() const
void QQuickEventPoint::setGrabber(QQuickItem *grabber)
{
+ if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled()) && m_grabber.data() != grabber) {
+ auto device = static_cast<const QQuickPointerEvent *>(parent())->device();
+ static const QMetaEnum stateMetaEnum = metaObject()->enumerator(metaObject()->indexOfEnumerator("State"));
+ QString deviceName = (device ? device->name() : QLatin1String("null device"));
+ deviceName.resize(16, ' '); // shorten, and align in case of sequential output
+ qCDebug(lcPointerGrab) << deviceName << "point" << hex << m_pointId << stateMetaEnum.valueToKey(state())
+ << ": grab" << m_grabber << "->" << grabber;
+ }
m_grabber = QPointer<QQuickItem>(grabber);
}
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 45bc7b2e8b..26959ef584 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1556,11 +1556,11 @@ void QQuickFlickablePrivate::replayDelayedPress()
// If we have the grab, release before delivering the event
if (QQuickWindow *w = q->window()) {
+ replayingPressEvent = true;
if (w->mouseGrabberItem() == q)
q->ungrabMouse();
// Use the event handler that will take care of finding the proper item to propagate the event
- replayingPressEvent = true;
QCoreApplication::sendEvent(w, mouseEvent.data());
replayingPressEvent = false;
}
@@ -1590,7 +1590,7 @@ void QQuickFlickable::timerEvent(QTimerEvent *event)
d->movementEndingTimer.stop();
d->pressed = false;
d->stealMouse = false;
- if (!d->velocityTimeline.isActive())
+ if (!d->velocityTimeline.isActive() && !d->timeline.isActive())
movementEnding(true, true);
}
}
@@ -1643,7 +1643,7 @@ void QQuickFlickable::viewportMoved(Qt::Orientations orient)
void QQuickFlickablePrivate::viewportAxisMoved(AxisData &data, qreal minExtent, qreal maxExtent, qreal vSize,
QQuickTimeLineCallback::Callback fixupCallback)
{
- if (pressed || calcVelocity) {
+ if (!scrollingPhase && (pressed || calcVelocity)) {
int elapsed = data.velocityTime.restart();
if (elapsed > 0) {
qreal velocity = (data.lastPos - data.move.value()) * 1000 / elapsed;
@@ -2216,7 +2216,8 @@ void QQuickFlickable::mouseUngrabEvent()
Q_D(QQuickFlickable);
// if our mouse grab has been removed (probably by another Flickable),
// fix our state
- d->cancelInteraction();
+ if (!d->replayingPressEvent)
+ d->cancelInteraction();
}
void QQuickFlickablePrivate::cancelInteraction()
@@ -2235,21 +2236,28 @@ void QQuickFlickablePrivate::cancelInteraction()
}
}
-bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event)
+/*!
+ QQuickFlickable::filterMouseEvent checks filtered mouse events and potentially steals them.
+
+ This is how flickable takes over events from other items (\a receiver) that are on top of it.
+ It filters their events and may take over (grab) the \a event.
+ Return true if the mouse event will be stolen.
+ \internal
+*/
+bool QQuickFlickable::filterMouseEvent(QQuickItem *receiver, QMouseEvent *event)
{
Q_D(QQuickFlickable);
QPointF localPos = mapFromScene(event->windowPos());
- QQuickWindow *c = window();
- QQuickItem *grabber = c ? c->mouseGrabberItem() : 0;
- if (grabber == this && d->stealMouse) {
+ Q_ASSERT_X(receiver != this, "", "Flickable received a filter event for itself");
+ if (receiver == this && d->stealMouse) {
// we are already the grabber and we do want the mouse event to ourselves.
return true;
}
- bool grabberDisabled = grabber && !grabber->isEnabled();
+ bool receiverDisabled = receiver && !receiver->isEnabled();
bool stealThisEvent = d->stealMouse;
- if ((stealThisEvent || contains(localPos)) && (!grabber || !grabber->keepMouseGrab() || grabberDisabled)) {
+ if ((stealThisEvent || contains(localPos)) && (!receiver || !receiver->keepMouseGrab() || receiverDisabled)) {
QScopedPointer<QMouseEvent> mouseEvent(QQuickWindowPrivate::cloneMouseEvent(event, &localPos));
mouseEvent->setAccepted(false);
@@ -2259,7 +2267,7 @@ bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event)
break;
case QEvent::MouseButtonPress:
d->handleMousePressEvent(mouseEvent.data());
- d->captureDelayedPress(item, event);
+ d->captureDelayedPress(receiver, event);
stealThisEvent = d->stealMouse; // Update stealThisEvent in case changed by function call above
break;
case QEvent::MouseButtonRelease:
@@ -2269,15 +2277,14 @@ bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event)
default:
break;
}
- grabber = qobject_cast<QQuickItem*>(c->mouseGrabberItem());
- if ((grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) || grabberDisabled) {
+ if ((receiver && stealThisEvent && !receiver->keepMouseGrab() && receiver != this) || receiverDisabled) {
d->clearDelayedPress();
grabMouse();
} else if (d->delayedPressEvent) {
grabMouse();
}
- const bool filtered = stealThisEvent || d->delayedPressEvent || grabberDisabled;
+ const bool filtered = stealThisEvent || d->delayedPressEvent || receiverDisabled;
if (filtered) {
event->setAccepted(true);
}
@@ -2286,7 +2293,7 @@ bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event)
d->lastPosTime = -1;
returnToBounds();
}
- if (event->type() == QEvent::MouseButtonRelease || (grabber && grabber->keepMouseGrab() && !grabberDisabled)) {
+ if (event->type() == QEvent::MouseButtonRelease || (receiver && receiver->keepMouseGrab() && !receiverDisabled)) {
// mouse released, or another item has claimed the grab
d->lastPosTime = -1;
d->clearDelayedPress();
@@ -2306,7 +2313,7 @@ bool QQuickFlickable::childMouseEventFilter(QQuickItem *i, QEvent *e)
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
case QEvent::MouseButtonRelease:
- return sendMouseEvent(i, static_cast<QMouseEvent *>(e));
+ return filterMouseEvent(i, static_cast<QMouseEvent *>(e));
case QEvent::UngrabMouse:
if (d->window && d->window->mouseGrabberItem() && d->window->mouseGrabberItem() != this) {
// The grab has been taken away from a child and given to some other item.
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index cd727a2a68..2da4781f37 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -275,7 +275,7 @@ protected:
void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry) Q_DECL_OVERRIDE;
void mouseUngrabEvent() Q_DECL_OVERRIDE;
- bool sendMouseEvent(QQuickItem *item, QMouseEvent *event);
+ bool filterMouseEvent(QQuickItem *receiver, QMouseEvent *event);
bool xflick() const;
bool yflick() const;
diff --git a/src/quick/items/qquickflipable_p.h b/src/quick/items/qquickflipable_p.h
index d5a1e54d25..a76977d4ac 100644
--- a/src/quick/items/qquickflipable_p.h
+++ b/src/quick/items/qquickflipable_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_flipable);
+
#include "qquickitem.h"
#include <QtGui/qtransform.h>
diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp
index 857cd44b15..18a6a58467 100644
--- a/src/quick/items/qquickframebufferobject.cpp
+++ b/src/quick/items/qquickframebufferobject.cpp
@@ -42,6 +42,8 @@
#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLFunctions>
#include <private/qquickitem_p.h>
+#include <private/qsgadaptationlayer_p.h>
+#include <qsgtextureprovider.h>
#include <QSGSimpleTextureNode>
#include <QSGRendererInterface>
diff --git a/src/quick/items/qquickgridview_p.h b/src/quick/items/qquickgridview_p.h
index 44bc8444f2..aaf6e4a75b 100644
--- a/src/quick/items/qquickgridview_p.h
+++ b/src/quick/items/qquickgridview_p.h
@@ -51,8 +51,11 @@
// We mean it.
//
-#include "qquickitemview_p.h"
+#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_gridview);
+#include "qquickitemview_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 09d5e55c24..cbe1bac5c9 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2344,7 +2344,9 @@ QQuickItem::~QQuickItem()
if (d->extra.isAllocated()) {
delete d->extra->contents; d->extra->contents = 0;
+#if QT_CONFIG(quick_shadereffect)
delete d->extra->layer; d->extra->layer = 0;
+#endif
}
delete d->_anchors; d->_anchors = 0;
@@ -4774,8 +4776,10 @@ void QQuickItem::classBegin()
d->_stateGroup->classBegin();
if (d->_anchors)
d->_anchors->classBegin();
+#if QT_CONFIG(quick_shadereffect)
if (d->extra.isAllocated() && d->extra->layer)
d->extra->layer->classBegin();
+#endif
}
/*!
@@ -4795,8 +4799,10 @@ void QQuickItem::componentComplete()
}
if (d->extra.isAllocated()) {
+#if QT_CONFIG(quick_shadereffect)
if (d->extra->layer)
d->extra->layer->componentComplete();
+#endif
if (d->extra->keyHandler)
d->extra->keyHandler->componentComplete();
@@ -4852,8 +4858,10 @@ QPointF QQuickItemPrivate::computeTransformOrigin() const
void QQuickItemPrivate::transformChanged()
{
+#if QT_CONFIG(quick_shadereffect)
if (extra.isAllocated() && extra->layer)
extra->layer->updateMatrix();
+#endif
}
void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e)
@@ -5235,8 +5243,10 @@ void QQuickItem::setZ(qreal v)
emit zChanged();
+#if QT_CONFIG(quick_shadereffect)
if (d->extra.isAllocated() && d->extra->layer)
d->extra->layer->updateZ();
+#endif
}
/*!
@@ -7023,15 +7033,6 @@ void QQuickItemPrivate::setHasHoverInChild(bool hasHover)
}
}
-void QQuickItemPrivate::markObjects(QV4::ExecutionEngine *e)
-{
- Q_Q(QQuickItem);
- QV4::QObjectWrapper::markWrapper(q, e);
-
- for (QQuickItem *child : qAsConst(childItems))
- QQuickItemPrivate::get(child)->markObjects(e);
-}
-
#ifndef QT_NO_CURSOR
/*!
@@ -7647,9 +7648,13 @@ QDebug operator<<(QDebug debug, QQuickItem *item)
bool QQuickItem::isTextureProvider() const
{
+#if QT_CONFIG(quick_shadereffect)
Q_D(const QQuickItem);
return d->extra.isAllocated() && d->extra->layer && d->extra->layer->effectSource() ?
d->extra->layer->effectSource()->isTextureProvider() : false;
+#else
+ return false;
+#endif
}
/*!
@@ -7663,9 +7668,13 @@ bool QQuickItem::isTextureProvider() const
QSGTextureProvider *QQuickItem::textureProvider() const
{
+#if QT_CONFIG(quick_shadereffect)
Q_D(const QQuickItem);
return d->extra.isAllocated() && d->extra->layer && d->extra->layer->effectSource() ?
d->extra->layer->effectSource()->textureProvider() : 0;
+#else
+ return 0;
+#endif
}
/*!
@@ -7674,14 +7683,19 @@ QSGTextureProvider *QQuickItem::textureProvider() const
*/
QQuickItemLayer *QQuickItemPrivate::layer() const
{
+#if QT_CONFIG(quick_shadereffect)
if (!extra.isAllocated() || !extra->layer) {
extra.value().layer = new QQuickItemLayer(const_cast<QQuickItem *>(q_func()));
if (!componentComplete)
extra->layer->classBegin();
}
return extra->layer;
+#else
+ return 0;
+#endif
}
+#if QT_CONFIG(quick_shadereffect)
QQuickItemLayer::QQuickItemLayer(QQuickItem *item)
: m_item(item)
, m_enabled(false)
@@ -8169,12 +8183,16 @@ void QQuickItemLayer::updateMatrix()
ld->extra.value().origin = QQuickItemPrivate::get(m_item)->origin();
ld->dirty(QQuickItemPrivate::Transform);
}
+#endif // quick_shadereffect
QQuickItemPrivate::ExtraData::ExtraData()
: z(0), scale(1), rotation(0), opacity(1),
contents(0), screenAttached(0), layoutDirectionAttached(0),
enterKeyAttached(0),
- keyHandler(0), layer(0),
+ keyHandler(0),
+#if QT_CONFIG(quick_shadereffect)
+ layer(0),
+#endif
effectRefCount(0), hideRefCount(0),
opacityNode(0), clipNode(0), rootNode(0),
acceptedMouseButtons(0), origin(QQuickItem::Center),
@@ -8195,6 +8213,37 @@ QAccessible::Role QQuickItemPrivate::accessibleRole() const
}
#endif
+// helper code to let a visual parent mark its visual children for the garbage collector
+
+namespace QV4 {
+namespace Heap {
+struct QQuickItemWrapper : public QObjectWrapper {
+};
+}
+}
+
+struct QQuickItemWrapper : public QV4::QObjectWrapper {
+ V4_OBJECT2(QQuickItemWrapper, QV4::QObjectWrapper)
+ static void markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine *e);
+};
+
+DEFINE_OBJECT_VTABLE(QQuickItemWrapper);
+
+void QQuickItemWrapper::markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine *e)
+{
+ QObjectWrapper::Data *This = static_cast<QObjectWrapper::Data *>(that);
+ if (QQuickItem *item = static_cast<QQuickItem*>(This->object())) {
+ foreach (QQuickItem *child, QQuickItemPrivate::get(item)->childItems)
+ QV4::QObjectWrapper::markWrapper(child, e);
+ }
+ QV4::QObjectWrapper::markObjects(that, e);
+}
+
+quint64 QQuickItemPrivate::_q_createJSWrapper(QV4::ExecutionEngine *engine)
+{
+ return (engine->memoryManager->allocObject<QQuickItemWrapper>(q_func()))->asReturnedValue();
+}
+
QT_END_NAMESPACE
#include <moc_qquickitem.cpp>
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index 87ae83246c..510d46739a 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -148,6 +148,7 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QQmlParserStatus
Q_PRIVATE_PROPERTY(QQuickItem::d_func(), QQuickItemLayer *layer READ layer DESIGNABLE false CONSTANT FINAL)
Q_CLASSINFO("DefaultProperty", "data")
+ Q_CLASSINFO("qt_QmlJSWrapperFactoryMethod", "_q_createJSWrapper(QV4::ExecutionEngine*)")
public:
enum Flag {
@@ -442,6 +443,7 @@ protected:
private:
Q_PRIVATE_SLOT(d_func(), void _q_resourceObjectDeleted(QObject *))
+ Q_PRIVATE_SLOT(d_func(), quint64 _q_createJSWrapper(QV4::ExecutionEngine *))
friend class QQuickWindow;
friend class QQuickWindowPrivate;
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index c5cac2ff1e..7781c94f95 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -76,7 +76,9 @@
#include <QtCore/qdebug.h>
#include <QtCore/qelapsedtimer.h>
+#if QT_CONFIG(quick_shadereffect)
#include <QtQuick/private/qquickshadereffectsource_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -135,6 +137,7 @@ public:
QList<QQuickItem *> items;
};
+#if QT_CONFIG(quick_shadereffect)
class QQuickItemLayer : public QObject, public QQuickItemChangeListener
{
@@ -236,6 +239,8 @@ private:
QQuickShaderEffectSource::TextureMirroring m_textureMirroring;
};
+#endif
+
class Q_QUICK_PRIVATE_EXPORT QQuickItemPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QQuickItem)
@@ -300,6 +305,7 @@ public:
void _q_resourceObjectDeleted(QObject *);
void _q_windowChanged(QQuickWindow *w);
+ quint64 _q_createJSWrapper(QV4::ExecutionEngine *engine);
enum ChangeType {
Geometry = 0x01,
@@ -338,7 +344,9 @@ public:
QQuickLayoutMirroringAttached* layoutDirectionAttached;
QQuickEnterKeyAttached *enterKeyAttached;
QQuickItemKeyFilter *keyHandler;
+#if QT_CONFIG(quick_shadereffect)
mutable QQuickItemLayer *layer;
+#endif
#ifndef QT_NO_CURSOR
QCursor cursor;
#endif
@@ -593,9 +601,6 @@ public:
void setHasCursorInChild(bool hasCursor);
void setHasHoverInChild(bool hasHover);
- // recursive helper to let a visual parent mark its visual children
- void markObjects(QV4::ExecutionEngine *e);
-
virtual void updatePolish() { }
};
@@ -925,7 +930,9 @@ Q_DECLARE_TYPEINFO(QQuickItemPrivate::ChangeListener, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
+#if QT_CONFIG(quick_shadereffect)
QML_DECLARE_TYPE(QQuickItemLayer)
+#endif
QML_DECLARE_TYPE(QQuickKeysAttached)
QML_DECLARE_TYPEINFO(QQuickKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
QML_DECLARE_TYPE(QQuickKeyNavigationAttached)
diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp
index 5c0caf5ca2..fd4a7d733f 100644
--- a/src/quick/items/qquickitemanimation.cpp
+++ b/src/quick/items/qquickitemanimation.cpp
@@ -42,7 +42,9 @@
#include "qquickstateoperations_p.h"
#include <private/qqmlproperty_p.h>
+#if QT_CONFIG(quick_path)
#include <private/qquickpath_p.h>
+#endif
#include "private/qparallelanimationgroupjob_p.h"
#include "private/qsequentialanimationgroupjob_p.h"
@@ -554,6 +556,8 @@ QAbstractAnimationJob* QQuickAnchorAnimation::transition(QQuickStateActions &act
return initInstance(animator);
}
+
+#if QT_CONFIG(quick_path)
/*!
\qmltype PathAnimation
\instantiates QQuickPathAnimation
@@ -1044,4 +1048,6 @@ QQuickPathAnimationAnimator::~QQuickPathAnimationAnimator()
}
}
+#endif // quick_path
+
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickitemanimation_p.h b/src/quick/items/qquickitemanimation_p.h
index df80272eaa..a503cff223 100644
--- a/src/quick/items/qquickitemanimation_p.h
+++ b/src/quick/items/qquickitemanimation_p.h
@@ -124,6 +124,8 @@ protected:
QObject *defaultTarget = 0) Q_DECL_OVERRIDE;
};
+#if QT_CONFIG(quick_path)
+
class QQuickItem;
class QQuickPath;
class QQuickPathAnimationPrivate;
@@ -199,10 +201,14 @@ Q_SIGNALS:
void endRotationChanged(qreal);
};
+#endif
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickParentAnimation)
QML_DECLARE_TYPE(QQuickAnchorAnimation)
+#if QT_CONFIG(quick_path)
QML_DECLARE_TYPE(QQuickPathAnimation)
+#endif
#endif // QQUICKITEMANIMATION_H
diff --git a/src/quick/items/qquickitemanimation_p_p.h b/src/quick/items/qquickitemanimation_p_p.h
index 99c973eb25..2d075dfab3 100644
--- a/src/quick/items/qquickitemanimation_p_p.h
+++ b/src/quick/items/qquickitemanimation_p_p.h
@@ -53,7 +53,9 @@
#include "qquickitemanimation_p.h"
+#if QT_CONFIG(quick_path)
#include <private/qquickpath_p.h>
+#endif
#include <private/qquickanimation_p_p.h>
QT_BEGIN_NAMESPACE
@@ -84,6 +86,8 @@ public:
QList<QQuickItem*> targets;
};
+#if QT_CONFIG(quick_path)
+
class QQuickPathAnimationUpdater : public QQuickBulkValueUpdater
{
public:
@@ -153,6 +157,7 @@ public:
QHash<QQuickItem*, QQuickPathAnimationAnimator* > activeAnimations;
};
+#endif
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickitemgrabresult.cpp b/src/quick/items/qquickitemgrabresult.cpp
index 6865ee2654..c6355ceed2 100644
--- a/src/quick/items/qquickitemgrabresult.cpp
+++ b/src/quick/items/qquickitemgrabresult.cpp
@@ -37,17 +37,21 @@
**
****************************************************************************/
+#include <private/qtquickglobal_p.h>
#include "qquickitemgrabresult.h"
#include "qquickwindow.h"
#include "qquickitem.h"
+#if QT_CONFIG(quick_shadereffect)
#include "qquickshadereffectsource_p.h"
+#endif
#include <QtQml/QQmlEngine>
#include <private/qquickpixmapcache_p.h>
#include <private/qquickitem_p.h>
#include <private/qsgcontext_p.h>
+#include <private/qsgadaptationlayer_p.h>
QT_BEGIN_NAMESPACE
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()
diff --git a/src/quick/items/qquickitemview_p.h b/src/quick/items/qquickitemview_p.h
index 0e9a2f31be..3ac54ea3dc 100644
--- a/src/quick/items/qquickitemview_p.h
+++ b/src/quick/items/qquickitemview_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_itemview);
+
#include "qquickflickable_p.h"
#include <qpointer.h>
#include <QtCore/QLoggingCategory>
diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h
index f3d39bd360..a8e66301c1 100644
--- a/src/quick/items/qquickitemview_p_p.h
+++ b/src/quick/items/qquickitemview_p_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_itemview);
+
#include "qquickitemview_p.h"
#include "qquickitemviewtransition_p.h"
#include "qquickflickable_p_p.h"
diff --git a/src/quick/items/qquickitemviewtransition_p.h b/src/quick/items/qquickitemviewtransition_p.h
index e79c3b26f6..3d2f5361b1 100644
--- a/src/quick/items/qquickitemviewtransition_p.h
+++ b/src/quick/items/qquickitemviewtransition_p.h
@@ -52,6 +52,9 @@
//
#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_viewtransitions);
+
#include <QtCore/qobject.h>
#include <QtCore/qpoint.h>
#include <QtQml/qqml.h>
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index 47efecdb2d..30625c7ea8 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1765,7 +1765,7 @@ bool QQuickListViewPrivate::flick(AxisData &data, qreal minExtent, qreal maxExte
State should \e never be stored in a delegate.
ListView attaches a number of properties to the root item of the delegate, for example
- \c {ListView:isCurrentItem}. In the following example, the root delegate item can access
+ \c ListView.isCurrentItem. In the following example, the root delegate item can access
this attached property directly as \c ListView.isCurrentItem, while the child
\c contactInfo object must refer to this property as \c wrapper.ListView.isCurrentItem.
diff --git a/src/quick/items/qquicklistview_p.h b/src/quick/items/qquicklistview_p.h
index f84478acbd..3a871e88e9 100644
--- a/src/quick/items/qquicklistview_p.h
+++ b/src/quick/items/qquicklistview_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_listview);
+
#include "qquickitemview_p.h"
#include <private/qtquickglobal_p.h>
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 0118d882af..6bd83dd808 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -43,6 +43,7 @@
#include "qquickdrag_p.h"
#include <private/qqmldata_p.h>
+#include <private/qsgadaptationlayer_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qevent.h>
@@ -672,6 +673,7 @@ void QQuickMouseArea::mousePressEvent(QMouseEvent *event)
Q_D(QQuickMouseArea);
d->moved = false;
d->stealMouse = d->preventStealing;
+ d->overThreshold = false;
if (!d->enabled || !(event->button() & acceptedMouseButtons())) {
QQuickItem::mousePressEvent(event);
} else {
@@ -957,6 +959,7 @@ bool QQuickMouseArea::sendMouseEvent(QMouseEvent *event)
if (!d->pressed) {
// no other buttons are pressed
d->stealMouse = false;
+ d->overThreshold = false;
if (c && c->mouseGrabberItem() == this)
ungrabMouse();
emit canceled();
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp
index d68cb8e3f6..706980cd13 100644
--- a/src/quick/items/qquickmultipointtoucharea.cpp
+++ b/src/quick/items/qquickmultipointtoucharea.cpp
@@ -470,8 +470,10 @@ void QQuickMultiPointTouchArea::grabGesture()
QVector<int> ids;
ids.reserve(_touchPoints.size());
- for (auto it = _touchPoints.keyBegin(), end = _touchPoints.keyEnd(); it != end; ++it)
- ids.append(*it);
+ for (auto it = _touchPoints.keyBegin(), end = _touchPoints.keyEnd(); it != end; ++it) {
+ if (*it != -1) // -1 might be the mouse-point, but we already grabbed the mouse above.
+ ids.append(*it);
+ }
grabTouchPoints(ids);
setKeepTouchGrab(true);
}
@@ -852,10 +854,10 @@ bool QQuickMultiPointTouchArea::sendMouseEvent(QMouseEvent *event)
return false;
}
-bool QQuickMultiPointTouchArea::childMouseEventFilter(QQuickItem *i, QEvent *event)
+bool QQuickMultiPointTouchArea::childMouseEventFilter(QQuickItem *receiver, QEvent *event)
{
if (!isEnabled() || !isVisible())
- return QQuickItem::childMouseEventFilter(i, event);
+ return QQuickItem::childMouseEventFilter(receiver, event);
switch (event->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
@@ -878,7 +880,7 @@ bool QQuickMultiPointTouchArea::childMouseEventFilter(QQuickItem *i, QEvent *eve
default:
break;
}
- return QQuickItem::childMouseEventFilter(i, event);
+ return QQuickItem::childMouseEventFilter(receiver, event);
}
bool QQuickMultiPointTouchArea::shouldFilter(QEvent *event)
diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h
index b9ef7816e0..541eb04764 100644
--- a/src/quick/items/qquickmultipointtoucharea_p.h
+++ b/src/quick/items/qquickmultipointtoucharea_p.h
@@ -247,7 +247,7 @@ Q_SIGNALS:
protected:
void touchEvent(QTouchEvent *) Q_DECL_OVERRIDE;
- bool childMouseEventFilter(QQuickItem *i, QEvent *event) Q_DECL_OVERRIDE;
+ bool childMouseEventFilter(QQuickItem *receiver, QEvent *event) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquickopenglshadereffect_p.h b/src/quick/items/qquickopenglshadereffect_p.h
index ed56a76409..64e79a9343 100644
--- a/src/quick/items/qquickopenglshadereffect_p.h
+++ b/src/quick/items/qquickopenglshadereffect_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_shadereffect);
+
#include <QtQuick/qquickitem.h>
#include <QtQuick/qsgmaterial.h>
diff --git a/src/quick/items/qquickopenglshadereffectnode_p.h b/src/quick/items/qquickopenglshadereffectnode_p.h
index 5abe3ae3d0..aea28e6612 100644
--- a/src/quick/items/qquickopenglshadereffectnode_p.h
+++ b/src/quick/items/qquickopenglshadereffectnode_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_shadereffect);
+
#include <QtQuick/qsgnode.h>
#include <QtQuick/qsgmaterial.h>
#include <QtQuick/qsgtextureprovider.h>
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index bc89de5a1c..e565fceab8 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -43,6 +43,7 @@
#include <QtQuick/private/qsgdefaultpainternode_p.h>
#include <QtQuick/private/qsgcontext_p.h>
#include <private/qsgadaptationlayer_p.h>
+#include <qsgtextureprovider.h>
#include <qmath.h>
diff --git a/src/quick/items/qquickpathview_p.h b/src/quick/items/qquickpathview_p.h
index 1232f72935..669ef60ef7 100644
--- a/src/quick/items/qquickpathview_p.h
+++ b/src/quick/items/qquickpathview_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_pathview);
+
#include "qquickitem.h"
#include <private/qtquickglobal_p.h>
diff --git a/src/quick/items/qquickpathview_p_p.h b/src/quick/items/qquickpathview_p_p.h
index 571bb2e9e2..082f427f2c 100644
--- a/src/quick/items/qquickpathview_p_p.h
+++ b/src/quick/items/qquickpathview_p_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_pathview);
+
#include "qquickpathview_p.h"
#include "qquickitem_p.h"
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 38e89e78eb..e22427ca49 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -872,7 +872,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
@@ -1039,7 +1039,7 @@ void QQuickColumn::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
@@ -1307,7 +1307,7 @@ void QQuickRow::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
@@ -1882,7 +1882,7 @@ void QQuickGrid::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h
index f6388f111d..c25ecd6dbc 100644
--- a/src/quick/items/qquickpositioners_p.h
+++ b/src/quick/items/qquickpositioners_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_positioners);
+
#include "qquickimplicitsizeitem_p.h"
#include "qquickitemviewtransition_p.h"
diff --git a/src/quick/items/qquickpositioners_p_p.h b/src/quick/items/qquickpositioners_p_p.h
index d18f9b3724..6dd84e6098 100644
--- a/src/quick/items/qquickpositioners_p_p.h
+++ b/src/quick/items/qquickpositioners_p_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_positioners);
+
#include "qquickpositioners_p.h"
#include "qquickimplicitsizeitem_p_p.h"
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index 9e747f2c47..7ba2421d62 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -365,7 +365,7 @@ QQuickPen *QQuickRectangle::border()
The gradient to use to fill the rectangle.
This property allows for the construction of simple vertical gradients.
- Other gradients may by formed by adding rotation to the rectangle.
+ Other gradients may be formed by adding rotation to the rectangle.
\div {class="float-left"}
\inlineimage declarative-rect_gradient.png
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 8b69447002..74aa2da9e0 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -47,8 +47,10 @@
#ifndef QT_NO_OPENGL
# include <QtGui/QOpenGLContext>
# include <QtQuick/private/qsgdefaultrendercontext_p.h>
+#if QT_CONFIG(quick_shadereffect)
# include <QtQuick/private/qquickopenglshadereffectnode_p.h>
#endif
+#endif
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
@@ -190,7 +192,7 @@ void QQuickRenderControlPrivate::windowDestroyed()
delete QQuickWindowPrivate::get(window)->animationController;
QQuickWindowPrivate::get(window)->animationController = 0;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache();
#endif
diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h
index 17b009039a..2b7ff4cf6e 100644
--- a/src/quick/items/qquickshadereffect_p.h
+++ b/src/quick/items/qquickshadereffect_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_shadereffect);
+
#include <QtQuick/qquickitem.h>
#include <private/qtquickglobal_p.h>
diff --git a/src/quick/items/qquickshadereffectmesh.cpp b/src/quick/items/qquickshadereffectmesh.cpp
index 20b8d23af3..d23b576d42 100644
--- a/src/quick/items/qquickshadereffectmesh.cpp
+++ b/src/quick/items/qquickshadereffectmesh.cpp
@@ -137,7 +137,7 @@ QSGGeometry *QQuickGridMesh::updateGeometry(QSGGeometry *geometry, int attrCount
? QSGGeometry::defaultAttributes_Point2D()
: QSGGeometry::defaultAttributes_TexturedPoint2D(),
(vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2),
- QSGGeometry::TypeUnsignedShort);
+ QSGGeometry::UnsignedShortType);
} else {
geometry->allocate((vmesh + 1) * (hmesh + 1), vmesh * 2 * (hmesh + 2));
diff --git a/src/quick/items/qquickshadereffectmesh_p.h b/src/quick/items/qquickshadereffectmesh_p.h
index 5e255e73a3..aa3112b5a5 100644
--- a/src/quick/items/qquickshadereffectmesh_p.h
+++ b/src/quick/items/qquickshadereffectmesh_p.h
@@ -37,6 +37,10 @@
**
****************************************************************************/
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_shadereffect);
+
#include "qqmlparserstatus.h"
#include <QtQuick/qtquickglobal.h>
diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h
index ee18bf195a..5e7e354feb 100644
--- a/src/quick/items/qquickshadereffectsource_p.h
+++ b/src/quick/items/qquickshadereffectsource_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <QtQuick/private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_shadereffect);
+
#include "qquickitem.h"
#include <QtQuick/qsgtextureprovider.h>
#include <private/qsgadaptationlayer_p.h>
diff --git a/src/quick/items/qquicksprite_p.h b/src/quick/items/qquicksprite_p.h
index 684d432f39..d68a45ecc0 100644
--- a/src/quick/items/qquicksprite_p.h
+++ b/src/quick/items/qquicksprite_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include <QObject>
#include <QUrl>
#include <QVariantMap>
@@ -325,4 +329,5 @@ private:
};
QT_END_NAMESPACE
+
#endif // QQUICKSPRITE_P_H
diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h
index 5154dd7a31..89de9ce4f2 100644
--- a/src/quick/items/qquickspriteengine_p.h
+++ b/src/quick/items/qquickspriteengine_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include <QObject>
#include <QVector>
#include <QTimer>
diff --git a/src/quick/items/qquickspritesequence_p.h b/src/quick/items/qquickspritesequence_p.h
index 34af110a98..b80a8348aa 100644
--- a/src/quick/items/qquickspritesequence_p.h
+++ b/src/quick/items/qquickspritesequence_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include <QtQuick/QQuickItem>
#include <QTime>
diff --git a/src/quick/items/qquickspritesequence_p_p.h b/src/quick/items/qquickspritesequence_p_p.h
index 4f352b5b69..3579833116 100644
--- a/src/quick/items/qquickspritesequence_p_p.h
+++ b/src/quick/items/qquickspritesequence_p_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include "qquickitem_p.h"
#include "qquicksprite_p.h"
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 14268b472e..2bfb4501fc 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -898,11 +898,11 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline)
// If the width of the item has changed and it's possible the result of wrapping,
// eliding, scaling has changed, or the text is not left aligned do another layout.
- if ((lineWidth < qMin(oldWidth, naturalWidth) || (widthExceeded && lineWidth > oldWidth))
+ if ((!qFuzzyCompare(lineWidth, oldWidth) || (widthExceeded && lineWidth > oldWidth))
&& (singlelineElide || multilineElide || canWrap || horizontalFit
|| q->effectiveHAlign() != QQuickText::AlignLeft)) {
widthChanged = true;
- widthExceeded = false;
+ widthExceeded = lineWidth >= qMin(oldWidth, naturalWidth);
heightExceeded = false;
continue;
}
@@ -937,7 +937,7 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const baseline)
bool wasInLayout = internalWidthUpdate;
internalWidthUpdate = true;
- q->setImplicitHeight(naturalHeight);
+ q->setImplicitHeight(naturalHeight + q->topPadding() + q->bottomPadding());
internalWidthUpdate = wasInLayout;
multilineElide = elideMode == QQuickText::ElideRight
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index d79d8ba3cd..a167f01484 100644
--- a/src/quick/items/qquickview.cpp
+++ b/src/quick/items/qquickview.cpp
@@ -48,29 +48,11 @@
#include <QtQml/qqmlengine.h>
#include <private/qqmlengine_p.h>
+#include <private/qv4qobjectwrapper_p.h>
#include <QtCore/qbasictimer.h>
QT_BEGIN_NAMESPACE
-DEFINE_OBJECT_VTABLE(QV4::QQuickRootItemMarker);
-
-QV4::Heap::QQuickRootItemMarker *QV4::QQuickRootItemMarker::create(QQmlEngine *engine, QQuickWindow *window)
-{
- QV4::ExecutionEngine *e = QQmlEnginePrivate::getV4Engine(engine);
- return e->memoryManager->allocObject<QQuickRootItemMarker>(window);
-}
-
-void QV4::QQuickRootItemMarker::markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine *e)
-{
- QQuickItem *root = static_cast<QQuickRootItemMarker::Data *>(that)->window->contentItem();
- if (root) {
- QQuickItemPrivate *rootPrivate = QQuickItemPrivate::get(root);
- rootPrivate->markObjects(e);
- }
-
- QV4::Object::markObjects(that, e);
-}
-
void QQuickViewPrivate::init(QQmlEngine* e)
{
Q_Q(QQuickView);
@@ -84,10 +66,10 @@ void QQuickViewPrivate::init(QQmlEngine* e)
engine.data()->setIncubationController(q->incubationController());
{
+ // The content item has CppOwnership policy (set in QQuickWindow). Ensure the presence of a JS
+ // wrapper so that the garbage collector can see the policy.
QV4::ExecutionEngine *v4 = QQmlEnginePrivate::getV4Engine(engine.data());
- QV4::Scope scope(v4);
- QV4::Scoped<QV4::QQuickRootItemMarker> v(scope, QV4::QQuickRootItemMarker::create(engine.data(), q));
- rootItemMarker.set(v4, v);
+ QV4::QObjectWrapper::wrap(v4, contentItem);
}
}
diff --git a/src/quick/items/qquickview_p.h b/src/quick/items/qquickview_p.h
index c21468ef53..a090bdc9f7 100644
--- a/src/quick/items/qquickview_p.h
+++ b/src/quick/items/qquickview_p.h
@@ -108,37 +108,8 @@ public:
QQuickView::ResizeMode resizeMode;
QSize initialSize;
QElapsedTimer frameTimer;
- QV4::PersistentValue rootItemMarker;
};
-namespace QV4 {
-namespace Heap {
-
-struct QQuickRootItemMarker : Object {
- inline QQuickRootItemMarker(QQuickWindow *window)
- : window(window)
- {
- }
-
- QQuickWindow *window;
-};
-
-}
-
-struct QQuickRootItemMarker : public Object
-{
- V4_OBJECT2(QQuickRootItemMarker, Object)
-
- static Heap::QQuickRootItemMarker *create(QQmlEngine *engine, QQuickWindow *window);
-
- static void markObjects(QV4::Heap::Base *that, QV4::ExecutionEngine *e);
-
-};
-
-
-
-}
-
QT_END_NAMESPACE
#endif // QQUICKVIEW_P_H
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 834841333b..f81c939ec6 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -706,8 +706,6 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
}
} else if (p.state() & Qt::TouchPointReleased) {
// currently handled point was released
- touchMouseId = -1;
- touchMouseDevice = nullptr;
if (QQuickItem *mouseGrabberItem = q->mouseGrabberItem()) {
QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event, mouseGrabberItem, false));
QCoreApplication::sendEvent(item, me.data());
@@ -722,6 +720,9 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
}
if (q->mouseGrabberItem()) // might have ungrabbed due to event
q->mouseGrabberItem()->ungrabMouse();
+
+ touchMouseId = -1;
+ touchMouseDevice = nullptr;
return me->isAccepted();
}
}
@@ -740,16 +741,16 @@ void QQuickWindowPrivate::setMouseGrabber(QQuickItem *grabber)
qCDebug(DBG_MOUSE_TARGET) << "grabber" << q->mouseGrabberItem() << "->" << grabber;
QQuickItem *oldGrabber = q->mouseGrabberItem();
- QQuickPointerEvent *event = QQuickPointerDevice::genericMouseDevice()->pointerEvent();
- Q_ASSERT(event->pointCount() == 1);
- event->point(0)->setGrabber(grabber);
-
if (grabber && touchMouseId != -1 && touchMouseDevice) {
// update the touch item for mouse touch id to the new grabber
qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << touchMouseId << "->" << q->mouseGrabberItem();
auto point = touchMouseDevice->pointerEvent()->pointById(touchMouseId);
if (point)
point->setGrabber(grabber);
+ } else {
+ QQuickPointerEvent *event = QQuickPointerDevice::genericMouseDevice()->pointerEvent();
+ Q_ASSERT(event->pointCount() == 1);
+ event->point(0)->setGrabber(grabber);
}
if (oldGrabber) {
@@ -762,13 +763,30 @@ void QQuickWindowPrivate::setMouseGrabber(QQuickItem *grabber)
void QQuickWindowPrivate::grabTouchPoints(QQuickItem *grabber, const QVector<int> &ids)
{
- Q_Q(QQuickWindow);
QSet<QQuickItem*> ungrab;
for (int i = 0; i < ids.count(); ++i) {
// FIXME: deprecate this function, we need a device
+ int id = ids.at(i);
+ if (Q_UNLIKELY(id < 0)) {
+ qWarning("ignoring grab of touchpoint %d", id);
+ continue;
+ }
+ if (id == touchMouseId) {
+ auto point = touchMouseDevice->pointerEvent()->pointById(id);
+ auto touchMouseGrabber = point->grabber();
+ if (touchMouseGrabber) {
+ point->setGrabber(nullptr);
+ touchMouseGrabber->mouseUngrabEvent();
+ ungrab.insert(touchMouseGrabber);
+ touchMouseDevice = nullptr;
+ touchMouseId = -1;
+ }
+ qCDebug(DBG_MOUSE_TARGET) << "grabTouchPoints: mouse grabber changed due to grabTouchPoints:" << touchMouseGrabber << "-> null";
+ }
+
const auto touchDevices = QQuickPointerDevice::touchDevices();
for (auto device : touchDevices) {
- auto point = device->pointerEvent()->pointById(ids.at(i));
+ auto point = device->pointerEvent()->pointById(id);
if (!point)
continue;
QQuickItem *oldGrabber = point->grabber();
@@ -779,12 +797,6 @@ void QQuickWindowPrivate::grabTouchPoints(QQuickItem *grabber, const QVector<int
if (oldGrabber)
ungrab.insert(oldGrabber);
}
-
- QQuickItem *mouseGrabberItem = q->mouseGrabberItem();
- if (touchMouseId == ids.at(i) && mouseGrabberItem && mouseGrabberItem != grabber) {
- qCDebug(DBG_MOUSE_TARGET) << "grabTouchPoints: grabber" << mouseGrabberItem << "-> null";
- setMouseGrabber(nullptr);
- }
}
for (QQuickItem *oldGrabber : qAsConst(ungrab))
oldGrabber->touchUngrabEvent();
@@ -1466,6 +1478,15 @@ QObject *QQuickWindow::focusObject() const
*/
QQuickItem *QQuickWindow::mouseGrabberItem() const
{
+ Q_D(const QQuickWindow);
+
+ if (d->touchMouseId != -1 && d->touchMouseDevice) {
+ QQuickPointerEvent *event = d->touchMouseDevice->pointerEvent();
+ auto point = event->pointById(d->touchMouseId);
+ Q_ASSERT(point);
+ return point->grabber();
+ }
+
QQuickPointerEvent *event = QQuickPointerDevice::genericMouseDevice()->pointerEvent();
Q_ASSERT(event->pointCount());
return event->point(0)->grabber();
@@ -2252,6 +2273,10 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
auto point = event->point(0);
if (point->isAccepted())
return false;
+
+ // The only reason to already have a mouse grabber here is
+ // synthetic events - flickable sends one when setPressDelay is used.
+ auto oldMouseGrabber = q->mouseGrabberItem();
QPointF localPos = item->mapFromScene(point->scenePos());
Q_ASSERT(item->contains(localPos)); // transform is checked already
QMouseEvent *me = event->asMouseEvent(localPos);
@@ -2259,7 +2284,7 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
q->sendEvent(item, me);
if (me->isAccepted()) {
auto mouseGrabber = q->mouseGrabberItem();
- if (mouseGrabber && mouseGrabber != item) {
+ if (mouseGrabber && mouseGrabber != item && mouseGrabber != oldMouseGrabber) {
item->mouseUngrabEvent();
} else {
item->grabMouse();
diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp
index 8ab2cee96f..ea1fc2f106 100644
--- a/src/quick/items/qquickwindowmodule.cpp
+++ b/src/quick/items/qquickwindowmodule.cpp
@@ -47,6 +47,7 @@
#include <private/qguiapplication_p.h>
#include <private/qqmlengine_p.h>
+#include <private/qv4qobjectwrapper_p.h>
#include <qpa/qplatformintegration.h>
QT_BEGIN_NAMESPACE
@@ -106,12 +107,11 @@ void QQuickWindowQmlImpl::classBegin()
if (e && !e->incubationController())
e->setIncubationController(incubationController());
}
- Q_ASSERT(e);
{
+ // The content item has CppOwnership policy (set in QQuickWindow). Ensure the presence of a JS
+ // wrapper so that the garbage collector can see the policy.
QV4::ExecutionEngine *v4 = QQmlEnginePrivate::getV4Engine(e);
- QV4::Scope scope(v4);
- QV4::ScopedObject v(scope, QV4::QQuickRootItemMarker::create(e, this));
- d->rootItemMarker = v;
+ QV4::QObjectWrapper::wrap(v4, d->contentItem);
}
}
diff --git a/src/quick/qtquickglobal.h b/src/quick/qtquickglobal.h
index f6f8f42e7f..5e83c1db84 100644
--- a/src/quick/qtquickglobal.h
+++ b/src/quick/qtquickglobal.h
@@ -40,7 +40,9 @@
#ifndef QTQUICKGLOBAL_H
#define QTQUICKGLOBAL_H
-#include <QtCore/qglobal.h>
+#include <QtQml/qtqmlglobal.h>
+#include <QtGui/qtguiglobal.h>
+#include <QtQuick/qtquick-config.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h
index 3c313de0a1..f6376a6d17 100644
--- a/src/quick/qtquickglobal_p.h
+++ b/src/quick/qtquickglobal_p.h
@@ -40,6 +40,10 @@
#ifndef QTQUICKGLOBAL_P_H
#define QTQUICKGLOBAL_P_H
+#include <QtQml/private/qtqmlglobal_p.h>
+#include <QtGui/private/qtguiglobal_p.h>
+#include <QtQuick/private/qtquick-config_p.h>
+
#include <QtCore/qloggingcategory.h>
//
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index 4909f7fce8..8f4f9a8290 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -1,12 +1,8 @@
TARGET = QtQuick
QT = core-private gui-private qml-private
-!no_network {
- QT_PRIVATE = network
-}
-no_network {
- DEFINES += QT_NO_NETWORK
-}
+qtConfig(qml-network): \
+ QT_PRIVATE += network
DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES
win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS
@@ -32,7 +28,8 @@ ANDROID_BUNDLED_FILES += \
include(util/util.pri)
include(scenegraph/scenegraph.pri)
include(items/items.pri)
-include(designer/designer.pri)
+qtConfig(quick-designer): \
+ include(designer/designer.pri)
qtConfig(accessibility) {
include(accessible/accessible.pri)
}
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
index 80112c1121..05d5daa686 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext.cpp
@@ -47,7 +47,9 @@
#include "qsgsoftwarepublicnodes_p.h"
#include "qsgsoftwarelayer_p.h"
#include "qsgsoftwarerenderer_p.h"
+#if QT_CONFIG(quick_sprite)
#include "qsgsoftwarespritenode_p.h"
+#endif
#include <QtCore/QCoreApplication>
#include <QtCore/QElapsedTimer>
@@ -184,10 +186,12 @@ QSGNinePatchNode *QSGSoftwareContext::createNinePatchNode()
return new QSGSoftwareNinePatchNode;
}
+#if QT_CONFIG(quick_sprite)
QSGSpriteNode *QSGSoftwareContext::createSpriteNode()
{
return new QSGSoftwareSpriteNode;
}
+#endif
QSGRendererInterface::GraphicsApi QSGSoftwareContext::graphicsApi() const
{
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h
index dcc137b4b4..1f14717416 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarecontext_p.h
@@ -98,7 +98,9 @@ public:
QSGRectangleNode *createRectangleNode() override;
QSGImageNode *createImageNode() override;
QSGNinePatchNode *createNinePatchNode() override;
+#if QT_CONFIG(quick_sprite)
QSGSpriteNode *createSpriteNode() override;
+#endif
GraphicsApi graphicsApi() const override;
ShaderType shaderType() const override;
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp
index 7b9e749532..59c47db0c4 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp
@@ -45,7 +45,9 @@
#include "qsgsoftwarepublicnodes_p.h"
#include "qsgsoftwarepainternode_p.h"
#include "qsgsoftwarepixmaptexture_p.h"
+#if QT_CONFIG(quick_sprite)
#include "qsgsoftwarespritenode_p.h"
+#endif
#include <qsgsimplerectnode.h>
#include <qsgsimpletexturenode.h>
@@ -91,9 +93,11 @@ QSGSoftwareRenderableNode::QSGSoftwareRenderableNode(NodeType type, QSGNode *nod
case QSGSoftwareRenderableNode::SimpleImage:
m_handle.simpleImageNode = static_cast<QSGImageNode*>(node);
break;
+#if QT_CONFIG(quick_sprite)
case QSGSoftwareRenderableNode::SpriteNode:
m_handle.spriteNode = static_cast<QSGSoftwareSpriteNode*>(node);
break;
+#endif
case QSGSoftwareRenderableNode::RenderNode:
m_handle.renderNode = static_cast<QSGRenderNode*>(node);
break;
@@ -182,10 +186,12 @@ void QSGSoftwareRenderableNode::update()
boundingRect = m_handle.simpleImageNode->rect().toRect();
break;
+#if QT_CONFIG(quick_sprite)
case QSGSoftwareRenderableNode::SpriteNode:
m_isOpaque = m_handle.spriteNode->isOpaque();
boundingRect = m_handle.spriteNode->rect().toRect();
break;
+#endif
case QSGSoftwareRenderableNode::RenderNode:
if (m_handle.renderNode->flags().testFlag(QSGRenderNode::OpaqueRendering) && !m_transform.isRotating())
m_isOpaque = true;
@@ -317,9 +323,11 @@ QRegion QSGSoftwareRenderableNode::renderNode(QPainter *painter, bool forceOpaqu
case QSGSoftwareRenderableNode::SimpleImage:
static_cast<QSGSoftwareImageNode *>(m_handle.simpleImageNode)->paint(painter);
break;
+#if QT_CONFIG(quick_sprite)
case QSGSoftwareRenderableNode::SpriteNode:
static_cast<QSGSoftwareSpriteNode *>(m_handle.spriteNode)->paint(painter);
break;
+#endif
default:
break;
}
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h
index 0626b1e657..473578c185 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h
@@ -51,6 +51,8 @@
// We mean it.
//
+#include <QtQuick/private/qtquickglobal_p.h>
+
#include <QtGui/QRegion>
#include <QtCore/QRect>
#include <QtGui/QTransform>
@@ -84,7 +86,9 @@ public:
NinePatch,
SimpleRectangle,
SimpleImage,
+#if QT_CONFIG(quick_sprite)
SpriteNode,
+#endif
RenderNode
};
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
index 12dbf63353..4937565aa9 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
@@ -181,6 +181,7 @@ void QSGSoftwareRenderableNodeUpdater::endVisit(QSGRootNode *)
{
}
+#if QT_CONFIG(quick_sprite)
bool QSGSoftwareRenderableNodeUpdater::visit(QSGSpriteNode *node)
{
return updateRenderableNode(QSGSoftwareRenderableNode::SpriteNode, node);
@@ -190,6 +191,7 @@ void QSGSoftwareRenderableNodeUpdater::endVisit(QSGSpriteNode *)
{
}
+#endif
bool QSGSoftwareRenderableNodeUpdater::visit(QSGRenderNode *node)
{
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h
index f204867236..ca16f77c22 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater_p.h
@@ -86,8 +86,10 @@ public:
void endVisit(QSGGlyphNode *) override;
bool visit(QSGRootNode *) override;
void endVisit(QSGRootNode *) override;
+#if QT_CONFIG(quick_sprite)
bool visit(QSGSpriteNode *) override;
void endVisit(QSGSpriteNode *) override;
+#endif
bool visit(QSGRenderNode *) override;
void endVisit(QSGRenderNode *) override;
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp
index 4e34517dad..70dce71801 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder.cpp
@@ -141,6 +141,7 @@ void QSGSoftwareRenderListBuilder::endVisit(QSGRootNode *)
{
}
+#if QT_CONFIG(quick_sprite)
bool QSGSoftwareRenderListBuilder::visit(QSGSpriteNode *node)
{
return addRenderableNode(node);
@@ -150,6 +151,7 @@ void QSGSoftwareRenderListBuilder::endVisit(QSGSpriteNode *)
{
}
+#endif
bool QSGSoftwareRenderListBuilder::visit(QSGRenderNode *node)
{
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h
index 807cb7fdbe..f5db30269f 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderlistbuilder_p.h
@@ -80,8 +80,10 @@ public:
void endVisit(QSGGlyphNode *) override;
bool visit(QSGRootNode *) override;
void endVisit(QSGRootNode *) override;
+#if QT_CONFIG(quick_sprite)
bool visit(QSGSpriteNode *) override;
void endVisit(QSGSpriteNode *) override;
+#endif
bool visit(QSGRenderNode *) override;
void endVisit(QSGRenderNode *) override;
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h
index 284ed3dff5..577a30c051 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include <private/qsgadaptationlayer_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick/scenegraph/adaptations/software/software.pri b/src/quick/scenegraph/adaptations/software/software.pri
index 97644fc36a..de5f01cdee 100644
--- a/src/quick/scenegraph/adaptations/software/software.pri
+++ b/src/quick/scenegraph/adaptations/software/software.pri
@@ -19,7 +19,6 @@ SOURCES += \
$$PWD/qsgsoftwarerenderloop.cpp \
$$PWD/qsgsoftwarelayer.cpp \
$$PWD/qsgsoftwareadaptation.cpp \
- $$PWD/qsgsoftwarespritenode.cpp \
$$PWD/qsgsoftwarethreadedrenderloop.cpp
HEADERS += \
@@ -39,5 +38,11 @@ HEADERS += \
$$PWD/qsgsoftwarerenderloop_p.h \
$$PWD/qsgsoftwarelayer_p.h \
$$PWD/qsgsoftwareadaptation_p.h \
- $$PWD/qsgsoftwarespritenode_p.h \
$$PWD/qsgsoftwarethreadedrenderloop_p.h
+
+qtConfig(quick-sprite) {
+ SOURCES += \
+ $$PWD/qsgsoftwarespritenode.cpp
+ HEADERS += \
+ $$PWD/qsgsoftwarespritenode_p.h
+}
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp
index 239557d527..b43a2bc2ba 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.cpp
+++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp
@@ -54,18 +54,18 @@ QT_BEGIN_NAMESPACE
QSGGeometry::Attribute QSGGeometry::Attribute::create(int attributeIndex, int tupleSize, int primitiveType, bool isPrimitive)
{
- Attribute a = { attributeIndex, tupleSize, primitiveType, isPrimitive, UNKNOWN, 0 };
+ Attribute a = { attributeIndex, tupleSize, primitiveType, isPrimitive, UnknownAttribute, 0 };
return a;
}
-QSGGeometry::Attribute QSGGeometry::Attribute::createWithSemantic(int pos, int tupleSize, int type, Semantic semantic)
+QSGGeometry::Attribute QSGGeometry::Attribute::createWithAttributeType(int pos, int tupleSize, int primitiveType, AttributeType attributeType)
{
Attribute a;
a.position = pos;
a.tupleSize = tupleSize;
- a.type = type;
- a.isVertexCoordinate = semantic == POSITION;
- a.semantic = semantic;
+ a.type = primitiveType;
+ a.isVertexCoordinate = attributeType == PositionAttribute;
+ a.attributeType = attributeType;
a.reserved = 0;
return a;
}
@@ -78,7 +78,7 @@ QSGGeometry::Attribute QSGGeometry::Attribute::createWithSemantic(int pos, int t
const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D()
{
static Attribute data[] = {
- Attribute::createWithSemantic(0, 2, TypeFloat, Attribute::POSITION)
+ Attribute::createWithAttributeType(0, 2, FloatType, PositionAttribute)
};
static AttributeSet attrs = { 1, sizeof(float) * 2, data };
return attrs;
@@ -91,8 +91,8 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D()
const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D()
{
static Attribute data[] = {
- Attribute::createWithSemantic(0, 2, TypeFloat, Attribute::POSITION),
- Attribute::createWithSemantic(1, 2, TypeFloat, Attribute::TEXCOORD)
+ Attribute::createWithAttributeType(0, 2, FloatType, PositionAttribute),
+ Attribute::createWithAttributeType(1, 2, FloatType, TexCoordAttribute)
};
static AttributeSet attrs = { 2, sizeof(float) * 4, data };
return attrs;
@@ -105,8 +105,8 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D(
const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
{
static Attribute data[] = {
- Attribute::createWithSemantic(0, 2, TypeFloat, Attribute::POSITION),
- Attribute::createWithSemantic(1, 4, TypeUnsignedByte, Attribute::COLOR)
+ Attribute::createWithAttributeType(0, 2, FloatType, PositionAttribute),
+ Attribute::createWithAttributeType(1, 4, UnsignedByteType, ColorAttribute)
};
static AttributeSet attrs = { 2, 2 * sizeof(float) + 4 * sizeof(char), data };
return attrs;
@@ -134,12 +134,31 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
\fn QSGGeometry::Attribute QSGGeometry::Attribute::create(int pos, int tupleSize, int primitiveType, bool isPosition)
Creates a new QSGGeometry::Attribute for attribute register \a pos with \a
- tupleSize. The \a primitiveType can be any of the supported OpenGL types,
- such as \c GL_FLOAT or \c GL_UNSIGNED_BYTE.
+ tupleSize. The \a primitiveType can be any of the supported types from
+ QSGGeometry::Type, such as QSGGeometry::FloatType or
+ QSGGeometry::UnsignedByteType.
- If the attribute describes the position for the vertex, the \a isPosition hint
- should be set to \c true. The scene graph renderer may use this information
- to perform optimizations.
+ If the attribute describes the position for the vertex, the \a isPosition
+ hint should be set to \c true. The scene graph renderer may use this
+ information to perform optimizations.
+
+ \note Scene graph backends for APIs other than OpenGL may require an
+ accurate description of attributes' usage, and therefore it is recommended
+ to use createWithAttributeType() instead.
+
+ Use the create function to construct the attribute, rather than an
+ initialization list, to ensure that all fields are initialized.
+ */
+
+/*!
+ \fn QSGGeometry::Attribute QSGGeometry::Attribute::createWithAttributeType(int pos, int tupleSize, int primitiveType, AttributeType attributeType)
+
+ Creates a new QSGGeometry::Attribute for attribute register \a pos with \a
+ tupleSize. The \a primitiveType can be any of the supported types from
+ QSGGeometry::Type, such as QSGGeometry::FloatType or
+ QSGGeometry::UnsignedByteType.
+
+ \a attributeType describes the intended use of the attribute.
Use the create function to construct the attribute, rather than an
initialization list, to ensure that all fields are initialized.
@@ -430,9 +449,9 @@ QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
"GL_UNSIGNED_INT is not supported, geometry will not render"
);
#endif
- if (indexType != TypeUnsignedByte
- && indexType != TypeUnsignedShort
- && indexType != TypeUnsignedInt) {
+ if (indexType != UnsignedByteType
+ && indexType != UnsignedShortType
+ && indexType != UnsignedIntType) {
qFatal("QSGGeometry: Unsupported index type, %x.\n", indexType);
}
@@ -549,13 +568,13 @@ const void *QSGGeometry::indexData() const
GL_UNSIGNED_BYTE, etc. QSGGeometry provies its own type in order to be able
to provide the same API with non-OpenGL backends as well.
- \value TypeByte
- \value TypeUnsignedByte
- \value TypeShort
- \value TypeUnsignedShort
- \value TypeInt
- \value TypeUnsignedInt
- \value TypeFloat
+ \value ByteType
+ \value UnsignedByteType
+ \value ShortType
+ \value UnsignedShortType
+ \value IntType
+ \value UnsignedIntType
+ \value FloatType
*/
/*!
@@ -653,8 +672,8 @@ void QSGGeometry::allocate(int vertexCount, int indexCount)
m_index_data_offset = -1;
m_owns_data = false;
} else {
- Q_ASSERT(m_index_type == TypeUnsignedInt || m_index_type == TypeUnsignedShort);
- int indexByteSize = indexCount * (m_index_type == TypeUnsignedShort ? sizeof(quint16) : sizeof(quint32));
+ Q_ASSERT(m_index_type == UnsignedIntType || m_index_type == UnsignedShortType);
+ int indexByteSize = indexCount * (m_index_type == UnsignedShortType ? sizeof(quint16) : sizeof(quint32));
m_data = (void *) malloc(vertexByteSize + indexByteSize);
m_index_data_offset = vertexByteSize;
m_owns_data = true;
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.h b/src/quick/scenegraph/coreapi/qsggeometry.h
index ae7b2f494c..00acb51c8a 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.h
+++ b/src/quick/scenegraph/coreapi/qsggeometry.h
@@ -51,30 +51,68 @@ class QSGGeometryData;
class Q_QUICK_EXPORT QSGGeometry
{
public:
+ enum AttributeType {
+ UnknownAttribute,
+ PositionAttribute,
+ ColorAttribute,
+ TexCoordAttribute,
+ TexCoord1Attribute,
+ TexCoord2Attribute
+ };
+
+ enum DataPattern {
+ AlwaysUploadPattern = 0,
+ StreamPattern = 1,
+ DynamicPattern = 2,
+ StaticPattern = 3
+ };
+
+ // Equivalents to GL_* drawing modes.
+ // Keep in sync with GL headers.
+ enum DrawingMode {
+ DrawPoints = 0x0000,
+ DrawLines = 0x0001,
+ DrawLineLoop = 0x0002,
+ DrawLineStrip = 0x0003,
+ DrawTriangles = 0x0004,
+ DrawTriangleStrip = 0x0005,
+ DrawTriangleFan = 0x0006
+ };
+
+ // Equivalents to GL_BYTE and similar type constants.
+ // Keep in sync with GL headers.
+ enum Type {
+ ByteType = 0x1400,
+ UnsignedByteType = 0x1401,
+ ShortType = 0x1402,
+ UnsignedShortType = 0x1403,
+ IntType = 0x1404,
+ UnsignedIntType = 0x1405,
+ FloatType = 0x1406,
+
+ TypeByte = ByteType,
+ TypeUnsignedByte = UnsignedByteType,
+ TypeShort = ShortType,
+ TypeUnsignedShort = UnsignedShortType,
+ TypeInt = IntType,
+ TypeUnsignedInt = UnsignedIntType,
+ TypeFloat = FloatType
+ };
struct Q_QUICK_EXPORT Attribute
{
- enum Semantic {
- UNKNOWN,
- POSITION,
- COLOR,
- TEXCOORD,
- TEXCOORD1,
- TEXCOORD2
- };
-
int position;
int tupleSize;
int type;
uint isVertexCoordinate : 1;
- Semantic semantic : 4;
+ AttributeType attributeType : 4;
uint reserved : 27;
static Attribute create(int pos, int tupleSize, int primitiveType, bool isPosition = false);
- static Attribute createWithSemantic(int pos, int tupleSize, int type, Semantic semantic);
+ static Attribute createWithAttributeType(int pos, int tupleSize, int primitiveType, AttributeType attributeType);
};
struct AttributeSet {
@@ -109,39 +147,10 @@ public:
static const AttributeSet &defaultAttributes_TexturedPoint2D();
static const AttributeSet &defaultAttributes_ColoredPoint2D();
- enum DataPattern {
- AlwaysUploadPattern = 0,
- StreamPattern = 1,
- DynamicPattern = 2,
- StaticPattern = 3
- };
-
- // Equivalents to GL_* drawing modes.
- enum DrawingMode {
- DrawPoints = 0x0000,
- DrawLines = 0x0001,
- DrawLineLoop = 0x0002,
- DrawLineStrip = 0x0003,
- DrawTriangles = 0x0004,
- DrawTriangleStrip = 0x0005,
- DrawTriangleFan = 0x0006
- };
-
- // Equivalents to GL_BYTE and similar type constants.
- enum Type {
- TypeByte = 0x1400,
- TypeUnsignedByte = 0x1401,
- TypeShort = 0x1402,
- TypeUnsignedShort = 0x1403,
- TypeInt = 0x1404,
- TypeUnsignedInt = 0x1405,
- TypeFloat = 0x1406
- };
-
QSGGeometry(const QSGGeometry::AttributeSet &attribs,
int vertexCount,
int indexCount = 0,
- int indexType = TypeUnsignedShort);
+ int indexType = UnsignedShortType);
virtual ~QSGGeometry();
// must use unsigned int to be compatible with the old GLenum to keep BC
@@ -223,25 +232,25 @@ private:
inline uint *QSGGeometry::indexDataAsUInt()
{
- Q_ASSERT(m_index_type == TypeUnsignedInt);
+ Q_ASSERT(m_index_type == UnsignedIntType);
return static_cast<uint *>(indexData());
}
inline quint16 *QSGGeometry::indexDataAsUShort()
{
- Q_ASSERT(m_index_type == TypeUnsignedShort);
+ Q_ASSERT(m_index_type == UnsignedShortType);
return static_cast<quint16 *>(indexData());
}
inline const uint *QSGGeometry::indexDataAsUInt() const
{
- Q_ASSERT(m_index_type == TypeUnsignedInt);
+ Q_ASSERT(m_index_type == UnsignedIntType);
return static_cast<const uint *>(indexData());
}
inline const quint16 *QSGGeometry::indexDataAsUShort() const
{
- Q_ASSERT(m_index_type == TypeUnsignedShort);
+ Q_ASSERT(m_index_type == UnsignedShortType);
return static_cast<const quint16 *>(indexData());
}
@@ -250,7 +259,7 @@ inline QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D()
Q_ASSERT(m_attributes.count == 1);
Q_ASSERT(m_attributes.stride == 2 * sizeof(float));
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[0].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[0].type == FloatType);
Q_ASSERT(m_attributes.attributes[0].position == 0);
return static_cast<Point2D *>(m_data);
}
@@ -261,10 +270,10 @@ inline QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D()
Q_ASSERT(m_attributes.stride == 4 * sizeof(float));
Q_ASSERT(m_attributes.attributes[0].position == 0);
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[0].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[0].type == FloatType);
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[1].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[1].type == FloatType);
return static_cast<TexturedPoint2D *>(m_data);
}
@@ -274,10 +283,10 @@ inline QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D()
Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char));
Q_ASSERT(m_attributes.attributes[0].position == 0);
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[0].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[0].type == FloatType);
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
- Q_ASSERT(m_attributes.attributes[1].type == TypeUnsignedByte);
+ Q_ASSERT(m_attributes.attributes[1].type == UnsignedByteType);
return static_cast<ColoredPoint2D *>(m_data);
}
@@ -286,7 +295,7 @@ inline const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const
Q_ASSERT(m_attributes.count == 1);
Q_ASSERT(m_attributes.stride == 2 * sizeof(float));
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[0].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[0].type == FloatType);
Q_ASSERT(m_attributes.attributes[0].position == 0);
return static_cast<const Point2D *>(m_data);
}
@@ -297,10 +306,10 @@ inline const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoin
Q_ASSERT(m_attributes.stride == 4 * sizeof(float));
Q_ASSERT(m_attributes.attributes[0].position == 0);
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[0].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[0].type == FloatType);
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[1].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[1].type == FloatType);
return static_cast<const TexturedPoint2D *>(m_data);
}
@@ -310,18 +319,18 @@ inline const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2
Q_ASSERT(m_attributes.stride == 2 * sizeof(float) + 4 * sizeof(char));
Q_ASSERT(m_attributes.attributes[0].position == 0);
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
- Q_ASSERT(m_attributes.attributes[0].type == TypeFloat);
+ Q_ASSERT(m_attributes.attributes[0].type == FloatType);
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
- Q_ASSERT(m_attributes.attributes[1].type == TypeUnsignedByte);
+ Q_ASSERT(m_attributes.attributes[1].type == UnsignedByteType);
return static_cast<const ColoredPoint2D *>(m_data);
}
int QSGGeometry::sizeOfIndex() const
{
- if (m_index_type == TypeUnsignedShort) return 2;
- else if (m_index_type == TypeUnsignedByte) return 1;
- else if (m_index_type == TypeUnsignedInt) return 4;
+ if (m_index_type == UnsignedShortType) return 2;
+ else if (m_index_type == UnsignedByteType) return 1;
+ else if (m_index_type == UnsignedIntType) return 4;
return 0;
}
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp
index 2211f88973..a1e1ef8c27 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.cpp
+++ b/src/quick/scenegraph/coreapi/qsgnode.cpp
@@ -1490,7 +1490,7 @@ QDebug operator<<(QDebug d, const QSGGeometryNode *n)
d << "#V:" << g->vertexCount() << "#I:" << g->indexCount();
- if (g->attributeCount() > 0 && g->attributes()->type == QSGGeometry::TypeFloat) {
+ if (g->attributeCount() > 0 && g->attributes()->type == QSGGeometry::FloatType) {
float x1 = 1e10, x2 = -1e10, y1=1e10, y2=-1e10;
int stride = g->sizeOfVertex();
for (int i = 0; i < g->vertexCount(); ++i) {
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h
index a74b38dba8..5880c67af0 100644
--- a/src/quick/scenegraph/qsgadaptationlayer_p.h
+++ b/src/quick/scenegraph/qsgadaptationlayer_p.h
@@ -108,8 +108,10 @@ public:
virtual void endVisit(QSGGlyphNode *) = 0;
virtual bool visit(QSGRootNode *) = 0;
virtual void endVisit(QSGRootNode *) = 0;
+#if QT_CONFIG(quick_sprite)
virtual bool visit(QSGSpriteNode *) = 0;
virtual void endVisit(QSGSpriteNode *) = 0;
+#endif
virtual bool visit(QSGRenderNode *) = 0;
virtual void endVisit(QSGRenderNode *) = 0;
@@ -213,6 +215,8 @@ Q_SIGNALS:
void scheduledUpdateCompleted();
};
+#if QT_CONFIG(quick_sprite)
+
class Q_QUICK_PRIVATE_EXPORT QSGSpriteNode : public QSGVisitableNode
{
public:
@@ -230,6 +234,8 @@ public:
virtual void accept(QSGNodeVisitorEx *visitor) { if (visitor->visit(this)) visitor->visitChildren(this); visitor->endVisit(this); }
};
+#endif
+
class Q_QUICK_PRIVATE_EXPORT QSGGuiThreadShaderEffectManager : public QObject
{
Q_OBJECT
diff --git a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
index 685a51550d..c8699218ba 100644
--- a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
+++ b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp
@@ -55,10 +55,10 @@ namespace
const QSGGeometry::AttributeSet &smoothAttributeSet()
{
static QSGGeometry::Attribute data[] = {
- QSGGeometry::Attribute::createWithSemantic(0, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::POSITION),
- QSGGeometry::Attribute::createWithSemantic(1, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::TEXCOORD),
- QSGGeometry::Attribute::createWithSemantic(2, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::TEXCOORD1),
- QSGGeometry::Attribute::createWithSemantic(3, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::TEXCOORD2)
+ QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType, QSGGeometry::PositionAttribute),
+ QSGGeometry::Attribute::createWithAttributeType(1, 2, QSGGeometry::FloatType, QSGGeometry::TexCoordAttribute),
+ QSGGeometry::Attribute::createWithAttributeType(2, 2, QSGGeometry::FloatType, QSGGeometry::TexCoord1Attribute),
+ QSGGeometry::Attribute::createWithAttributeType(3, 2, QSGGeometry::FloatType, QSGGeometry::TexCoord2Attribute)
};
static QSGGeometry::AttributeSet attrs = { 4, sizeof(SmoothVertex), data };
return attrs;
@@ -427,7 +427,7 @@ QSGGeometry *QSGBasicInternalImageNode::updateGeometry(const QRectF &targetRect,
if (!geometry) {
geometry = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(),
hCells * vCells * 4, hCells * vCells * 6,
- QSGGeometry::TypeUnsignedShort);
+ QSGGeometry::UnsignedShortType);
} else {
geometry->allocate(hCells * vCells * 4, hCells * vCells * 6);
}
diff --git a/src/quick/scenegraph/qsgbasicinternalrectanglenode.cpp b/src/quick/scenegraph/qsgbasicinternalrectanglenode.cpp
index 8fc850b60c..df124cce35 100644
--- a/src/quick/scenegraph/qsgbasicinternalrectanglenode.cpp
+++ b/src/quick/scenegraph/qsgbasicinternalrectanglenode.cpp
@@ -87,9 +87,9 @@ namespace
const QSGGeometry::AttributeSet &smoothAttributeSet()
{
static QSGGeometry::Attribute data[] = {
- QSGGeometry::Attribute::createWithSemantic(0, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::POSITION),
- QSGGeometry::Attribute::createWithSemantic(1, 4, QSGGeometry::TypeUnsignedByte, QSGGeometry::Attribute::COLOR),
- QSGGeometry::Attribute::createWithSemantic(2, 2, QSGGeometry::TypeFloat, QSGGeometry::Attribute::TEXCOORD)
+ QSGGeometry::Attribute::createWithAttributeType(0, 2, QSGGeometry::FloatType, QSGGeometry::PositionAttribute),
+ QSGGeometry::Attribute::createWithAttributeType(1, 4, QSGGeometry::UnsignedByteType, QSGGeometry::ColorAttribute),
+ QSGGeometry::Attribute::createWithAttributeType(2, 2, QSGGeometry::FloatType, QSGGeometry::TexCoordAttribute)
};
static QSGGeometry::AttributeSet attrs = { 3, sizeof(SmoothVertex), data };
return attrs;
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 688fc7db08..d52f69c7a3 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -307,10 +307,6 @@ QAnimationDriver *QSGContext::createAnimationDriver(QObject *parent)
QSize QSGContext::minimumFBOSize() const
{
-#ifdef Q_OS_MAC
- if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_8)
- return QSize(33, 33);
-#endif
return QSize(1, 1);
}
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h
index 899278843e..6b9db105e7 100644
--- a/src/quick/scenegraph/qsgcontext_p.h
+++ b/src/quick/scenegraph/qsgcontext_p.h
@@ -178,7 +178,9 @@ public:
virtual QSGGuiThreadShaderEffectManager *createGuiThreadShaderEffectManager();
virtual QSGShaderEffectNode *createShaderEffectNode(QSGRenderContext *renderContext,
QSGGuiThreadShaderEffectManager *mgr);
+#if QT_CONFIG(quick_sprite)
virtual QSGSpriteNode *createSpriteNode() = 0;
+#endif
virtual QAnimationDriver *createAnimationDriver(QObject *parent);
virtual QSize minimumFBOSize() const;
diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp
index 6964b74dc8..405f1d86a4 100644
--- a/src/quick/scenegraph/qsgdefaultcontext.cpp
+++ b/src/quick/scenegraph/qsgdefaultcontext.cpp
@@ -52,7 +52,9 @@
#include <QtQuick/private/qsgdefaultrectanglenode_p.h>
#include <QtQuick/private/qsgdefaultimagenode_p.h>
#include <QtQuick/private/qsgdefaultninepatchnode_p.h>
+#if QT_CONFIG(quick_sprite)
#include <QtQuick/private/qsgdefaultspritenode_p.h>
+#endif
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
@@ -258,10 +260,12 @@ QSGNinePatchNode *QSGDefaultContext::createNinePatchNode()
return new QSGDefaultNinePatchNode;
}
+#if QT_CONFIG(quick_sprite)
QSGSpriteNode *QSGDefaultContext::createSpriteNode()
{
return new QSGDefaultSpriteNode;
}
+#endif
QSGRendererInterface::GraphicsApi QSGDefaultContext::graphicsApi() const
{
diff --git a/src/quick/scenegraph/qsgdefaultcontext_p.h b/src/quick/scenegraph/qsgdefaultcontext_p.h
index 88db5e1e9a..ab319502ef 100644
--- a/src/quick/scenegraph/qsgdefaultcontext_p.h
+++ b/src/quick/scenegraph/qsgdefaultcontext_p.h
@@ -76,7 +76,9 @@ public:
QSGRectangleNode *createRectangleNode() override;
QSGImageNode *createImageNode() override;
QSGNinePatchNode *createNinePatchNode() override;
+#if QT_CONFIG(quick_sprite)
QSGSpriteNode *createSpriteNode() override;
+#endif
void setDistanceFieldEnabled(bool enabled);
bool isDistanceFieldEnabled() const;
diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp
index 6f10611ba3..1a17453baf 100644
--- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp
+++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp
@@ -99,12 +99,12 @@ void QSGDefaultRenderContext::initialize(void *context)
#ifdef Q_OS_LINUX
const char *vendor = (const char *) funcs->glGetString(GL_VENDOR);
- if (strstr(vendor, "nouveau"))
+ if (vendor && strstr(vendor, "nouveau"))
m_brokenIBOs = true;
const char *renderer = (const char *) funcs->glGetString(GL_RENDERER);
- if (strstr(renderer, "llvmpipe"))
+ if (renderer && strstr(renderer, "llvmpipe"))
m_serializedRender = true;
- if (strstr(vendor, "Hisilicon Technologies") && strstr(renderer, "Immersion.16"))
+ if (vendor && renderer && strstr(vendor, "Hisilicon Technologies") && strstr(renderer, "Immersion.16"))
m_brokenIBOs = true;
#endif
diff --git a/src/quick/scenegraph/qsgdefaultspritenode.cpp b/src/quick/scenegraph/qsgdefaultspritenode.cpp
index 89b26f8660..5eb8fb6e08 100644
--- a/src/quick/scenegraph/qsgdefaultspritenode.cpp
+++ b/src/quick/scenegraph/qsgdefaultspritenode.cpp
@@ -150,8 +150,8 @@ QSGMaterialShader *QQuickSpriteMaterial::createShader() const
}
static QSGGeometry::Attribute Sprite_Attributes[] = {
- QSGGeometry::Attribute::create(0, 2, QSGGeometry::TypeFloat, true), // pos
- QSGGeometry::Attribute::create(1, 2, QSGGeometry::TypeFloat), // tex
+ QSGGeometry::Attribute::create(0, 2, QSGGeometry::FloatType, true), // pos
+ QSGGeometry::Attribute::create(1, 2, QSGGeometry::FloatType), // tex
};
static QSGGeometry::AttributeSet Sprite_AttributeSet =
diff --git a/src/quick/scenegraph/qsgdefaultspritenode_p.h b/src/quick/scenegraph/qsgdefaultspritenode_p.h
index cb76bf8d83..78aa8cc0cf 100644
--- a/src/quick/scenegraph/qsgdefaultspritenode_p.h
+++ b/src/quick/scenegraph/qsgdefaultspritenode_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_sprite);
+
#include <private/qsgadaptationlayer_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index a59f9ddcc7..9ddbe5aa1d 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -61,8 +61,10 @@
#ifndef QT_NO_OPENGL
# include <QtGui/QOpenGLContext>
# include <private/qsgdefaultrendercontext_p.h>
+#if QT_CONFIG(quick_shadereffect)
# include <private/qquickopenglshadereffectnode_p.h>
#endif
+#endif
#ifdef Q_OS_WIN
# include <QtCore/qt_windows.h>
@@ -326,7 +328,7 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window)
if (Q_UNLIKELY(!current))
qCDebug(QSG_LOG_RENDERLOOP) << "cleanup without an OpenGL context";
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache();
#endif
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 6b9c67b2bd..693012154e 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -63,7 +63,9 @@
#include <private/qqmldebugserviceinterfaces_p.h>
#include <private/qqmldebugconnector_p.h>
+#if QT_CONFIG(quick_shadereffect)
#include <private/qquickopenglshadereffectnode_p.h>
+#endif
#include <private/qsgdefaultrendercontext_p.h>
/*
@@ -487,7 +489,9 @@ void QSGRenderThread::invalidateOpenGL(QQuickWindow *window, bool inDestructor,
QQuickWindowPrivate *dd = QQuickWindowPrivate::get(window);
+#if QT_CONFIG(quick_shadereffect)
QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache();
+#endif
// The canvas nodes must be cleaned up regardless if we are in the destructor..
if (wipeSG) {
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 743e524a36..941a7b3f3c 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -55,7 +55,7 @@
#include <private/qquickprofiler_p.h>
#include <private/qquickanimatorcontroller_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
#include <private/qquickopenglshadereffectnode_p.h>
#endif
@@ -245,7 +245,7 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window)
if (Q_UNLIKELY(!current))
qCDebug(QSG_LOG_RENDERLOOP) << "cleanup without an OpenGL context";
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache();
#endif
diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri
index a659ca5e10..edf4aa08c5 100644
--- a/src/quick/scenegraph/scenegraph.pri
+++ b/src/quick/scenegraph/scenegraph.pri
@@ -113,7 +113,6 @@ qtConfig(opengl(es1|es2)?) {
$$PWD/qsgdefaultinternalrectanglenode.cpp \
$$PWD/qsgdefaultrendercontext.cpp \
$$PWD/qsgdefaultcontext.cpp \
- $$PWD/qsgdefaultspritenode.cpp \
$$PWD/util/qsgdefaultpainternode.cpp \
$$PWD/util/qsgdefaultrectanglenode.cpp \
$$PWD/util/qsgdefaultimagenode.cpp \
@@ -129,7 +128,6 @@ qtConfig(opengl(es1|es2)?) {
$$PWD/qsgdefaultglyphnode_p_p.h \
$$PWD/qsgdefaultinternalimagenode_p.h \
$$PWD/qsgdefaultinternalrectanglenode_p.h \
- $$PWD/qsgdefaultspritenode_p.h \
$$PWD/qsgdefaultrendercontext_p.h \
$$PWD/qsgdefaultcontext_p.h \
$$PWD/util/qsgdefaultpainternode_p.h \
@@ -139,6 +137,13 @@ qtConfig(opengl(es1|es2)?) {
$$PWD/qsgdefaultlayer_p.h \
$$PWD/qsgthreadedrenderloop_p.h \
$$PWD/qsgwindowsrenderloop_p.h
+
+ qtConfig(quick-sprite) {
+ SOURCES += \
+ $$PWD/qsgdefaultspritenode.cpp
+ HEADERS += \
+ $$PWD/qsgdefaultspritenode_p.h
+ }
}
# Built-in, non-plugin-based adaptations
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
index e1aea290a3..389b9e0b4e 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
@@ -443,9 +443,21 @@ void QSGDefaultPainterNode::setContentsScale(qreal s)
markDirty(DirtyMaterial);
}
-void QSGDefaultPainterNode::setFastFBOResizing(bool dynamic)
+void QSGDefaultPainterNode::setFastFBOResizing(bool fastResizing)
{
- m_fastFBOResizing = dynamic;
+ if (m_fastFBOResizing == fastResizing)
+ return;
+
+ m_fastFBOResizing = fastResizing;
+ updateFBOSize();
+
+ if ((m_preferredRenderTarget == QQuickPaintedItem::FramebufferObject
+ || m_preferredRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject)
+ && (!m_fbo || (m_fbo && m_fbo->size() != m_fboSize))) {
+ m_dirtyRenderTarget = true;
+ m_dirtyGeometry = true;
+ m_dirtyTexture = true;
+ }
}
QImage QSGDefaultPainterNode::toImage() const
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
index a433b3292a..084fc1e004 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode_p.h
@@ -109,7 +109,7 @@ public:
void setContentsScale(qreal s) override;
qreal contentsScale() const { return m_contentsScale; }
- void setFastFBOResizing(bool dynamic) override;
+ void setFastFBOResizing(bool fastResizing) override;
bool fastFBOResizing() const { return m_fastFBOResizing; }
void setTextureSize(const QSize &textureSize) override;
diff --git a/src/quick/util/qquickanimator.cpp b/src/quick/util/qquickanimator.cpp
index 100b7bd402..5d2af0f940 100644
--- a/src/quick/util/qquickanimator.cpp
+++ b/src/quick/util/qquickanimator.cpp
@@ -502,7 +502,8 @@ QQuickRotationAnimator::RotationDirection QQuickRotationAnimator::direction() co
Q_D(const QQuickRotationAnimator);
return d->direction;
}
-#ifndef QT_NO_OPENGL
+
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
/*!
\qmltype UniformAnimator
\instantiates QQuickUniformAnimator
diff --git a/src/quick/util/qquickanimator_p.h b/src/quick/util/qquickanimator_p.h
index 807ed6da58..92c66299dc 100644
--- a/src/quick/util/qquickanimator_p.h
+++ b/src/quick/util/qquickanimator_p.h
@@ -169,7 +169,8 @@ protected:
QQuickAnimatorJob *createJob() const override;
QString propertyName() const override { return QStringLiteral("rotation"); }
};
-#ifndef QT_NO_OPENGL
+
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
class QQuickUniformAnimatorPrivate;
class Q_QUICK_PRIVATE_EXPORT QQuickUniformAnimator : public QQuickAnimator
{
@@ -200,7 +201,7 @@ QML_DECLARE_TYPE(QQuickYAnimator)
QML_DECLARE_TYPE(QQuickScaleAnimator)
QML_DECLARE_TYPE(QQuickRotationAnimator)
QML_DECLARE_TYPE(QQuickOpacityAnimator)
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
QML_DECLARE_TYPE(QQuickUniformAnimator)
#endif
#endif // QQUICKANIMATOR_P_H
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index a0c787dae5..1176cf1ff7 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -43,7 +43,7 @@
#include "qquickanimator_p_p.h"
#include <private/qquickwindow_p.h>
#include <private/qquickitem_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
# include <private/qquickopenglshadereffectnode_p.h>
# include <private/qquickopenglshadereffect_p.h>
#endif
@@ -329,11 +329,13 @@ void QQuickTransformAnimatorJob::Helper::sync()
| QQuickItemPrivate::Size;
QQuickItemPrivate *d = QQuickItemPrivate::get(item);
+#if QT_CONFIG(quick_shadereffect)
if (d->extra.isAllocated()
&& d->extra->layer
&& d->extra->layer->enabled()) {
d = QQuickItemPrivate::get(d->extra->layer->m_effectSource);
}
+#endif
quint32 dirty = mask & d->dirtyAttributes;
@@ -423,11 +425,13 @@ void QQuickOpacityAnimatorJob::initialize(QQuickAnimatorController *controller)
{
QQuickAnimatorJob::initialize(controller);
QQuickItemPrivate *d = QQuickItemPrivate::get(m_target);
+#if QT_CONFIG(quick_shadereffect)
if (d->extra.isAllocated()
&& d->extra->layer
&& d->extra->layer->enabled()) {
d = QQuickItemPrivate::get(d->extra->layer->m_effectSource);
}
+#endif
m_opacityNode = d->opacityNode();
if (!m_opacityNode) {
@@ -543,7 +547,7 @@ void QQuickRotationAnimatorJob::writeBack()
m_target->setRotation(value());
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
QQuickUniformAnimatorJob::QQuickUniformAnimatorJob()
: m_node(0)
, m_uniformIndex(-1)
diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp
index 6e23d99f7e..d13291c30a 100644
--- a/src/quick/util/qquickfontloader.cpp
+++ b/src/quick/util/qquickfontloader.cpp
@@ -52,7 +52,7 @@
#include <qqmlinfo.h>
#include <qqmlfile.h>
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
#include <QNetworkRequest>
#include <QNetworkReply>
#endif
@@ -70,7 +70,7 @@ Q_OBJECT
public:
explicit QQuickFontObject(int _id = -1);
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
void download(const QUrl &url, QNetworkAccessManager *manager);
Q_SIGNALS:
@@ -82,7 +82,7 @@ private:
private Q_SLOTS:
void replyFinished();
-#endif // QT_NO_NETWORK
+#endif // qml_network
public:
int id;
@@ -92,7 +92,7 @@ public:
QQuickFontObject::QQuickFontObject(int _id)
: QObject(0)
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
,redirectCount(0), reply(0)
#endif
,id(_id)
@@ -100,7 +100,7 @@ QQuickFontObject::QQuickFontObject(int _id)
}
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
void QQuickFontObject::download(const QUrl &url, QNetworkAccessManager *manager)
{
QNetworkRequest req(url);
@@ -141,7 +141,7 @@ void QQuickFontObject::replyFinished()
reply = 0;
}
}
-#endif // QT_NO_NETWORK
+#endif // qml_network
class QQuickFontLoaderPrivate : public QObjectPrivate
{
@@ -268,7 +268,7 @@ void QQuickFontLoader::setSource(const QUrl &url)
}
} else {
if (!fontLoaderFonts()->map.contains(d->url)) {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QQuickFontObject *fo = new QQuickFontObject;
fontLoaderFonts()->map[d->url] = fo;
fo->download(d->url, qmlEngine(this)->networkAccessManager());
@@ -282,7 +282,7 @@ void QQuickFontLoader::setSource(const QUrl &url)
} else {
QQuickFontObject *fo = fontLoaderFonts()->map.value(d->url);
if (fo->id == -1) {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
d->status = Loading;
emit statusChanged();
QObject::connect(fo, SIGNAL(fontDownloaded(QString,QQuickFontLoader::Status)),
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 6cecf6f6f6..0c245d2b23 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -105,7 +105,7 @@ QImage QQuickTextureFactory::image() const
}
/*!
- Returns a QQuickTextureFactory holding the given image.
+ Returns a QQuickTextureFactory holding the given \a image.
This is typically used as a helper in QQuickImageResponse::textureFactory.
@@ -187,6 +187,8 @@ QString QQuickImageResponse::errorString() const
This method is used to communicate that the response is no longer required by the engine.
It may be reimplemented to cancel a request in the provider side, however, it is not mandatory.
+
+ A cancelled QQuickImageResponse still needs to emit finished().
*/
void QQuickImageResponse::cancel()
{
diff --git a/src/quick/util/qquickpath_p.h b/src/quick/util/qquickpath_p.h
index 59f1ff3c69..06ad389b49 100644
--- a/src/quick/util/qquickpath_p.h
+++ b/src/quick/util/qquickpath_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_path);
+
#include <qqml.h>
#include <private/qqmlnullablevalue_p.h>
diff --git a/src/quick/util/qquickpath_p_p.h b/src/quick/util/qquickpath_p_p.h
index 3e4ccc7eb6..1dc3c1c47a 100644
--- a/src/quick/util/qquickpath_p_p.h
+++ b/src/quick/util/qquickpath_p_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_path);
+
#include "qquickpath_p.h"
#include <qqml.h>
diff --git a/src/quick/util/qquickpathinterpolator_p.h b/src/quick/util/qquickpathinterpolator_p.h
index ce18190977..0fdb1a444f 100644
--- a/src/quick/util/qquickpathinterpolator_p.h
+++ b/src/quick/util/qquickpathinterpolator_p.h
@@ -51,6 +51,10 @@
// We mean it.
//
+#include <private/qtquickglobal_p.h>
+
+QT_REQUIRE_CONFIG(quick_path);
+
#include <qqml.h>
#include <QObject>
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 987dd3c30f..7dffc09ba5 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -67,7 +67,7 @@
#include <QQmlFile>
#include <QMetaMethod>
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
#include <qqmlnetworkaccessmanagerfactory.h>
#include <QNetworkReply>
#include <QSslError>
@@ -206,7 +206,7 @@ private:
friend class QQuickPixmapReaderThreadObject;
void processJobs();
void processJob(QQuickPixmapReply *, const QUrl &, const QString &, AutoTransform, QQuickImageProvider::ImageType, QQuickImageProvider *);
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
void networkRequestDone(QNetworkReply *);
#endif
void asyncResponseFinished(QQuickImageResponse *);
@@ -220,7 +220,7 @@ private:
QQuickPixmapReaderThreadObject *threadObject;
QWaitCondition waitCondition;
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QNetworkAccessManager *networkAccessManager();
QNetworkAccessManager *accessManager;
QHash<QNetworkReply*,QQuickPixmapReply*> networkJobs;
@@ -349,7 +349,7 @@ QQuickPixmapReply::Event::~Event()
delete textureFactory;
}
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QNetworkAccessManager *QQuickPixmapReader::networkAccessManager()
{
if (!accessManager) {
@@ -430,7 +430,7 @@ static bool readImage(const QUrl& url, QIODevice *dev, QImage *image, QString *e
QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng)
: QThread(eng), engine(eng), threadObject(0)
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
, accessManager(0)
#endif
{
@@ -454,7 +454,7 @@ QQuickPixmapReader::~QQuickPixmapReader()
delete reply;
}
jobs.clear();
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
const auto cancelJob = [this](QQuickPixmapReply *reply) {
if (reply->loading) {
@@ -476,7 +476,7 @@ QQuickPixmapReader::~QQuickPixmapReader()
wait();
}
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply)
{
QQuickPixmapReply *job = networkJobs.take(reply);
@@ -526,7 +526,7 @@ void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply)
// kick off event loop again incase we have dropped below max request count
threadObject->processJobs();
}
-#endif // QT_NO_NETWORK
+#endif // qml_network
void QQuickPixmapReader::asyncResponseFinished(QQuickImageResponse *response)
{
@@ -577,7 +577,7 @@ bool QQuickPixmapReaderThreadObject::event(QEvent *e)
void QQuickPixmapReaderThreadObject::networkRequestDone()
{
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
QNetworkReply *reply = static_cast<QNetworkReply *>(sender());
reader->networkRequestDone(reply);
#endif
@@ -599,7 +599,7 @@ void QQuickPixmapReader::processJobs()
// Clean cancelled jobs
if (!cancelled.isEmpty()) {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
for (int i = 0; i < cancelled.count(); ++i) {
QQuickPixmapReply *job = cancelled.at(i);
QNetworkReply *reply = networkJobs.key(job, 0);
@@ -614,7 +614,6 @@ void QQuickPixmapReader::processJobs()
if (asyncResponse) {
asyncResponses.remove(asyncResponse);
asyncResponse->cancel();
- asyncResponse->deleteLater();
}
}
PIXMAP_PROFILE(pixmapStateChanged<QQuickProfiler::PixmapLoadingError>(job->url));
@@ -644,7 +643,7 @@ void QQuickPixmapReader::processJobs()
} else {
localFile = QQmlFile::urlToLocalFileOrQrc(url);
usableJob = !localFile.isEmpty()
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
|| networkJobs.count() < IMAGEREQUEST_MAX_NETWORK_REQUEST_COUNT
#endif
;
@@ -772,7 +771,7 @@ void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &u
runningJob->postReply(errorCode, errorStr, readSize, QQuickTextureFactory::textureFactoryForImage(image));
mutex.unlock();
} else {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
// Network resource
QNetworkRequest req(url);
req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true);
@@ -841,7 +840,7 @@ void QQuickPixmapReader::cancel(QQuickPixmapReply *reply)
void QQuickPixmapReader::run()
{
if (replyDownloadProgress == -1) {
-#ifndef QT_NO_NETWORK
+#if QT_CONFIG(qml_network)
replyDownloadProgress = QMetaMethod::fromSignal(&QNetworkReply::downloadProgress).methodIndex();
replyFinished = QMetaMethod::fromSignal(&QNetworkReply::finished).methodIndex();
const QMetaObject *ir = &QQuickPixmapReaderThreadObject::staticMetaObject;
diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp
index 66994e22ba..7e2973a78b 100644
--- a/src/quick/util/qquickutilmodule.cpp
+++ b/src/quick/util/qquickutilmodule.cpp
@@ -107,7 +107,7 @@ void QQuickUtilModule::defineModule()
qmlRegisterType<QQuickScaleAnimator>("QtQuick", 2, 2, "ScaleAnimator");
qmlRegisterType<QQuickRotationAnimator>("QtQuick", 2, 2, "RotationAnimator");
qmlRegisterType<QQuickOpacityAnimator>("QtQuick", 2, 2, "OpacityAnimator");
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
qmlRegisterType<QQuickUniformAnimator>("QtQuick", 2, 2, "UniformAnimator");
#endif
qmlRegisterType<QQuickStateOperation>();
diff --git a/src/quick/util/util.pri b/src/quick/util/util.pri
index 66792536d7..1ef1018a31 100644
--- a/src/quick/util/util.pri
+++ b/src/quick/util/util.pri
@@ -17,8 +17,6 @@ SOURCES += \
$$PWD/qquickbehavior.cpp \
$$PWD/qquickfontloader.cpp \
$$PWD/qquickstyledtext.cpp \
- $$PWD/qquickpath.cpp \
- $$PWD/qquickpathinterpolator.cpp \
$$PWD/qquickimageprovider.cpp \
$$PWD/qquicksvgparser.cpp \
$$PWD/qquickvaluetypes.cpp \
@@ -55,9 +53,6 @@ HEADERS += \
$$PWD/qquickbehavior_p.h \
$$PWD/qquickfontloader_p.h \
$$PWD/qquickstyledtext_p.h \
- $$PWD/qquickpath_p.h \
- $$PWD/qquickpath_p_p.h \
- $$PWD/qquickpathinterpolator_p.h \
$$PWD/qquickimageprovider.h \
$$PWD/qquicksvgparser_p.h \
$$PWD/qquickvaluetypes_p.h \
@@ -70,3 +65,13 @@ HEADERS += \
$$PWD/qquicktextmetrics_p.h \
$$PWD/qquickshortcut_p.h \
$$PWD/qquickvalidator_p.h
+
+qtConfig(quick-path) {
+ SOURCES += \
+ $$PWD/qquickpath.cpp \
+ $$PWD/qquickpathinterpolator.cpp
+ HEADERS += \
+ $$PWD/qquickpath_p.h \
+ $$PWD/qquickpath_p_p.h \
+ $$PWD/qquickpathinterpolator_p.h
+}