aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-02 09:05:12 +0100
committerLiang Qi <liang.qi@qt.io>2017-03-02 09:05:12 +0100
commit78dd18a0cd18449e1289e428ea6eca65e28fb114 (patch)
treebbb442c218d1504adb70d49ae67ac78a9c2c42bd /src/quick
parent015dff255ff0f40c553b1dee43c6cff013df64eb (diff)
parent8c864e52369ee4d55a1d9345215c8153144b5939 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/accessible/qaccessiblequickview.cpp8
-rw-r--r--src/quick/accessible/qaccessiblequickview_p.h1
-rw-r--r--src/quick/doc/snippets/qml/localstorage/hello.qml76
-rw-r--r--src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc2
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc22
-rw-r--r--src/quick/doc/src/concepts/positioning/topic.qdoc2
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc14
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc2
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp7
-rw-r--r--src/quick/items/qquickflickable.cpp5
-rw-r--r--src/quick/items/qquickitem.cpp10
-rw-r--r--src/quick/items/qquickmousearea.cpp28
-rw-r--r--src/quick/items/qquickopenglshadereffect.cpp10
-rw-r--r--src/quick/items/qquickshadereffect.cpp5
-rw-r--r--src/quick/items/qquickshadereffect_p.h2
-rw-r--r--src/quick/items/qquickwindow.cpp26
-rw-r--r--src/quick/scenegraph/qsgdefaultlayer.cpp7
-rw-r--r--src/quick/scenegraph/util/qsgdefaultpainternode.cpp6
-rw-r--r--src/quick/util/qquickanimatorjob.cpp4
-rw-r--r--src/quick/util/qquickimageprovider.cpp4
20 files changed, 184 insertions, 57 deletions
diff --git a/src/quick/accessible/qaccessiblequickview.cpp b/src/quick/accessible/qaccessiblequickview.cpp
index 222690e4f2..b3d1b6fc0f 100644
--- a/src/quick/accessible/qaccessiblequickview.cpp
+++ b/src/quick/accessible/qaccessiblequickview.cpp
@@ -81,6 +81,14 @@ QAccessibleInterface *QAccessibleQuickWindow::child(int index) const
return 0;
}
+QAccessibleInterface *QAccessibleQuickWindow::focusChild() const
+{
+ QObject *focusObject = window()->focusObject();
+ if (focusObject)
+ return QAccessible::queryAccessibleInterface(focusObject);
+ return nullptr;
+}
+
QAccessible::Role QAccessibleQuickWindow::role() const
{
return QAccessible::Window; // FIXME
diff --git a/src/quick/accessible/qaccessiblequickview_p.h b/src/quick/accessible/qaccessiblequickview_p.h
index 7c103380cb..39ffcaf39c 100644
--- a/src/quick/accessible/qaccessiblequickview_p.h
+++ b/src/quick/accessible/qaccessiblequickview_p.h
@@ -65,6 +65,7 @@ public:
QAccessibleInterface *parent() const override;
QAccessibleInterface *child(int index) const override;
+ QAccessibleInterface *focusChild() const override;
QAccessible::Role role() const override;
QAccessible::State state() const override;
diff --git a/src/quick/doc/snippets/qml/localstorage/hello.qml b/src/quick/doc/snippets/qml/localstorage/hello.qml
new file mode 100644
index 0000000000..959895c82a
--- /dev/null
+++ b/src/quick/doc/snippets/qml/localstorage/hello.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+import QtQuick 2.0
+
+Rectangle {
+ color: "white"
+ width: 200
+ height: 100
+
+ Text {
+ text: "?"
+ anchors.horizontalCenter: parent.horizontalCenter
+ function findGreetings() {
+ var db = openDatabaseSync("QDeclarativeExampleDB", "1.0", "The Example QML SQL!", 1000000);
+
+ db.transaction(
+ function(tx) {
+ // Create the database if it doesn't already exist
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+
+ // Add (another) greeting row
+ tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+
+ // Show all added greetings
+ var rs = tx.executeSql('SELECT * FROM Greeting');
+
+ var r = ""
+ for (var i = 0; i < rs.rows.length; i++) {
+ r += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + "\n"
+ }
+ text = r
+ }
+ )
+ }
+ Component.onCompleted: findGreetings()
+ }
+}
+//![0]
diff --git a/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc b/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc
index 20a6d131f5..e5834eb5c8 100644
--- a/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc
+++ b/src/quick/doc/src/concepts/layouts/qtquicklayouts-overview.qdoc
@@ -64,7 +64,7 @@
In addition to the above features, GridLayout adds these features:
\list
\li \l{Layout::row}{Grid coordinates} can be specified with the \l{Layout::row}{Layout.row} and
- \l{Layout::column}{Layout.column}.
+ \l{Layout::column}{Layout.column} properties.
\li \l{GridLayout::flow}{Automatic grid coordinates} used together with the
\l{GridLayout::flow}{flow}, \l{GridLayout::rows}{rows}, and
\l{GridLayout::columns}{columns} properties.
diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
index a764402c2f..12a107491a 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
@@ -36,10 +36,10 @@
Models can be defined in C++ and then made available to QML. This is useful
for exposing existing C++ data models or otherwise complex datasets to QML.
-A C++ model class can be defined as a \l QStringList, a QObjectList or a
-\l QAbstractItemModel. The first two are useful for exposing simpler datasets,
-while QAbstractItemModel provides a more flexible solution for more complex
-models.
+A C++ model class can be defined as a \l QStringList, a \l QVariantList, a
+QObjectList or a \l QAbstractItemModel. The first three are useful for exposing
+simpler datasets, while QAbstractItemModel provides a more flexible solution for
+more complex models.
\section2 QStringList-based Model
@@ -60,10 +60,20 @@ The complete source code for this example is available in
\l {models/stringlistmodel}{examples/quick/models/stringlistmodel}
within the Qt install directory.
-\b{Note:} There is no way for the view to know that the contents of a QStringList
-have changed. If the QStringList changes, it will be necessary to reset
+\note There is no way for the view to know that the contents of a QStringList
+have changed. If the QStringList changes, it will be necessary to reset
the model by calling QQmlContext::setContextProperty() again.
+\section2 QVariantList-based Model
+
+A model may be a single \l QVariantList, which provides the contents of the list
+via the \e modelData role.
+
+The API works just like with \l QStringList, as shown in the previous section.
+
+\note There is no way for the view to know that the contents of a QVariantList
+have changed. If the QVariantList changes, it will be necessary to reset
+the model.
\section2 QObjectList-based model
diff --git a/src/quick/doc/src/concepts/positioning/topic.qdoc b/src/quick/doc/src/concepts/positioning/topic.qdoc
index 92113ece54..b28acd1f89 100644
--- a/src/quick/doc/src/concepts/positioning/topic.qdoc
+++ b/src/quick/doc/src/concepts/positioning/topic.qdoc
@@ -112,7 +112,7 @@ them, and where possible, pristine Anchor layouts should be preferred.
\section1 Anchors
-Anchors allows an item to be placed either adjacent to or inside of another,
+Anchors allow an item to be placed either adjacent to or inside of another,
by attaching one or more of the item's anchor-points (boundaries) to an
anchor-point of the other. These anchors will remain even if the dimensions
or location of one of the items changes, allowing for highly dynamic
diff --git a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
index 3fd92177f9..d80c72e0f1 100644
--- a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
@@ -31,18 +31,14 @@
\section1 Scene Graph Adaptations in Qt Quick
-Originally Qt Quick only had one available renderer for parsing the scene graph
-and rendering the results to a render target. This renderer is now the default
-OpenGL Renderer which supports rendering either using the OpenGL ES 2.0 or
-OpenGL 2.0 (with framebuffer object extensions) APIs. The Qt Quick APIs have
-originally been designed with the assumption that OpenGL is always available.
-However, it is now possible to use other graphics API's to render Qt Quick
-scenes using the scene graph APIs.
+Originally Qt Quick always relied on OpenGL (OpenGL ES 2.0 or OpenGL 2.0) for parsing
+the scene graph and rendering the results to a render target. From Qt 5.8 onwards
+Qt Quick also supports rendering in software and with Direct3D 12.
\section1 Switching between the adaptation used by the application
-The default of the OpenGL, or - in Qt builds with disabled OpenGL support - the
-software adaptation, can be overridden either by using an environment variable
+The default rendering backend is still OpenGL, or - in Qt builds with disabled OpenGL support -
+the software renderer. This can be overridden either by using an environment variable
or a C++ API. The former consists of setting the \c{QT_QUICK_BACKEND} or the
legacy \c{QMLSCENE_DEVICE} environment variable before launching applications.
The latter is done by calling QQuickWindow::setSceneGraphBackend() early in the
diff --git a/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc b/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc
index fd5bf51307..f971043b58 100644
--- a/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/visualparent.qdoc
@@ -125,7 +125,7 @@ the blue rectangle and beneath any of the blue rectangle's children.
Stacking order can be influenced with the \l Item::z property. Z values below 0 will stack below the parent, and if z
values are assigned then siblings will stack in z-order (with creation order used to break ties). Z values only affect
-stacking compared to siblings and the parent item. If you have an item who is obscured by a subtree rooted above its
+stacking compared to siblings and the parent item. If you have an item which is obscured by a subtree rooted above its
parent item, no z value on that item will increase its stacking order to stack above that subtree. To stack that item
above the other subtree you'll have to alter z values farther up in the hierarchy, or re-arrange the visual item
hierarchy.
diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp
index 38b5f054bf..d90f527486 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp
@@ -48,6 +48,7 @@
#include <QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObjectFormat>
#include <QOpenGLFunctions>
+#include <QtGui/private/qopenglextensions_p.h>
#endif
#include <QtCore/QThread>
#include <QtGui/QGuiApplication>
@@ -499,9 +500,9 @@ bool QQuickContext2DFBOTexture::doMultisampling() const
static bool multisamplingSupported = false;
if (!extensionsChecked) {
- const QSet<QByteArray> extensions = QOpenGLContext::currentContext()->extensions();
- multisamplingSupported = extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_multisample"))
- && extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_blit"));
+ QOpenGLExtensions *e = static_cast<QOpenGLExtensions *>(QOpenGLContext::currentContext()->functions());
+ multisamplingSupported = e->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)
+ && e->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit);
extensionsChecked = true;
}
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 4ab604b30f..d97c731157 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -2349,8 +2349,11 @@ bool QQuickFlickable::filterMouseEvent(QQuickItem *receiver, QMouseEvent *event)
bool QQuickFlickable::childMouseEventFilter(QQuickItem *i, QEvent *e)
{
Q_D(QQuickFlickable);
- if (!isVisible() || !isEnabled() || !isInteractive())
+ if (!isVisible() || !isEnabled() || !isInteractive()) {
+ d->cancelInteraction();
return QQuickItem::childMouseEventFilter(i, e);
+ }
+
switch (e->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 22ee3f39e4..aa2662489d 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2911,14 +2911,15 @@ void QQuickItemPrivate::addChild(QQuickItem *child)
childItems.append(child);
-#if QT_CONFIG(cursor)
QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
+#if QT_CONFIG(cursor)
// if the added child has a cursor and we do not currently have any children
// with cursors, bubble the notification up
if (childPrivate->subtreeCursorEnabled && !subtreeCursorEnabled)
setHasCursorInChild(true);
#endif
+
if (childPrivate->subtreeHoverEnabled && !subtreeHoverEnabled)
setHasHoverInChild(true);
@@ -2939,13 +2940,14 @@ void QQuickItemPrivate::removeChild(QQuickItem *child)
childItems.removeOne(child);
Q_ASSERT(!childItems.contains(child));
-#if QT_CONFIG(cursor)
QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
+#if QT_CONFIG(cursor)
// turn it off, if nothing else is using it
if (childPrivate->subtreeCursorEnabled && subtreeCursorEnabled)
setHasCursorInChild(false);
#endif
+
if (childPrivate->subtreeHoverEnabled && subtreeHoverEnabled)
setHasHoverInChild(false);
@@ -3807,10 +3809,10 @@ QQuickItem::UpdatePaintNodeData::UpdatePaintNodeData()
/*!
This function is called when an item should release graphics
- resources which are not already managed by the nodes returend from
+ resources which are not already managed by the nodes returned from
QQuickItem::updatePaintNode().
- This happens when the item is about to be removed from window it
+ This happens when the item is about to be removed from the window it
was previously rendering to. The item is guaranteed to have a
\l {QQuickItem::window()}{window} when the function is called.
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index bb23b1fd54..c662efe40e 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -689,9 +689,10 @@ void QQuickMouseArea::mousePressEvent(QMouseEvent *event)
#endif
setHovered(true);
d->startScene = event->windowPos();
- d->pressAndHoldTimer.start(pressAndHoldInterval(), this);
setKeepMouseGrab(d->stealMouse);
event->setAccepted(setPressed(event->button(), true, event->source()));
+ if (event->isAccepted())
+ d->pressAndHoldTimer.start(pressAndHoldInterval(), this);
}
}
@@ -738,23 +739,34 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event)
bool dragY = drag()->axis() & QQuickDrag::YAxis;
QPointF dragPos = d->drag->target()->position();
+ QPointF boundedDragPos = dragPos;
if (dragX) {
- dragPos.setX(qBound(
+ dragPos.setX(startPos.x() + curLocalPos.x() - startLocalPos.x());
+ boundedDragPos.setX(qBound(
d->drag->xmin(),
- startPos.x() + curLocalPos.x() - startLocalPos.x(),
+ dragPos.x(),
d->drag->xmax()));
}
if (dragY) {
- dragPos.setY(qBound(
+ dragPos.setY(startPos.y() + curLocalPos.y() - startLocalPos.y());
+ boundedDragPos.setY(qBound(
d->drag->ymin(),
- startPos.y() + curLocalPos.y() - startLocalPos.y(),
+ dragPos.y(),
d->drag->ymax()));
}
+
+ QPointF targetPos = d->drag->target()->position();
+
if (d->drag->active())
- d->drag->target()->setPosition(dragPos);
+ d->drag->target()->setPosition(boundedDragPos);
+
+ bool dragOverThresholdX = QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(),
+ Qt::XAxis, event, d->drag->threshold());
+ bool dragOverThresholdY = QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(),
+ Qt::YAxis, event, d->drag->threshold());
- if (!d->overThreshold && (QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), Qt::XAxis, event, d->drag->threshold())
- || QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), Qt::YAxis, event, d->drag->threshold())))
+ if (!d->overThreshold && (((targetPos.x() != boundedDragPos.x()) && dragOverThresholdX) ||
+ ((targetPos.y() != boundedDragPos.y()) && dragOverThresholdY)))
{
d->overThreshold = true;
if (d->drag->smoothed())
diff --git a/src/quick/items/qquickopenglshadereffect.cpp b/src/quick/items/qquickopenglshadereffect.cpp
index 42fcee3c0d..4f4c403483 100644
--- a/src/quick/items/qquickopenglshadereffect.cpp
+++ b/src/quick/items/qquickopenglshadereffect.cpp
@@ -256,10 +256,14 @@ void QQuickOpenGLShaderEffectCommon::connectPropertySignals(QQuickItem *item,
qWarning("QQuickOpenGLShaderEffect: property '%s' does not have notification method!", d.name.constData());
} else {
auto *mapper = signalMappers[shaderType].at(i);
- mapper->setSignalIndex(pd->notifyIndex());
+ mapper->setSignalIndex(itemMetaObject->property(d.propertyIndex).notifySignal().methodIndex());
Q_ASSERT(item->metaObject() == itemMetaObject);
- QObjectPrivate::connectImpl(item, mapper->signalIndex(), item, nullptr, mapper,
- Qt::AutoConnection, nullptr, itemMetaObject);
+ bool ok = QObjectPrivate::connectImpl(item, pd->notifyIndex(), item, nullptr, mapper,
+ Qt::AutoConnection, nullptr, itemMetaObject);
+ if (!ok)
+ qWarning() << "Failed to connect to property" << itemMetaObject->property(d.propertyIndex).name()
+ << "(" << d.propertyIndex << ", signal index" << pd->notifyIndex()
+ << ") of item" << item;
}
} else {
// If the source is set via a dynamic property, like the layer is, then we need this
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index 7926607e33..436d7b33ce 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -873,4 +873,9 @@ void QQuickShaderEffectPrivate::updatePolish()
q->m_impl->maybeUpdateShaders();
}
+bool QQuickShaderEffect::isOpenGLShaderEffect() const
+{
+ return m_glImpl != Q_NULLPTR;
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h
index 7885daffbb..d269dc5e50 100644
--- a/src/quick/items/qquickshadereffect_p.h
+++ b/src/quick/items/qquickshadereffect_p.h
@@ -117,6 +117,8 @@ public:
bool isComponentComplete() const;
QString parseLog();
+ bool isOpenGLShaderEffect() const;
+
Q_SIGNALS:
void fragmentShaderChanged();
void vertexShaderChanged();
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 57810e4ec9..4dc8cd0a37 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -635,8 +635,8 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
// FIXME: make this work for mouse events too and get rid of the asTouchEvent in here.
Q_ASSERT(pointerEvent->asPointerTouchEvent());
- QTouchEvent *event = pointerEvent->asPointerTouchEvent()->touchEventForItem(item);
- if (!event)
+ QScopedPointer<QTouchEvent> event(pointerEvent->asPointerTouchEvent()->touchEventForItem(item));
+ if (event.isNull())
return false;
// For each point, check if it is accepted, if not, try the next point.
@@ -653,7 +653,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
break;
qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << p.id() << "->" << item;
- QScopedPointer<QMouseEvent> mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event, item, false));
+ QScopedPointer<QMouseEvent> mousePress(touchToMouseEvent(QEvent::MouseButtonPress, p, event.data(), item, false));
// Send a single press and see if that's accepted
QCoreApplication::sendEvent(item, mousePress.data());
@@ -667,7 +667,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
pointerEventPoint->setGrabber(item);
if (checkIfDoubleClicked(event->timestamp())) {
- QScopedPointer<QMouseEvent> mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event, item, false));
+ QScopedPointer<QMouseEvent> mouseDoubleClick(touchToMouseEvent(QEvent::MouseButtonDblClick, p, event.data(), item, false));
QCoreApplication::sendEvent(item, mouseDoubleClick.data());
event->setAccepted(mouseDoubleClick->isAccepted());
if (!mouseDoubleClick->isAccepted()) {
@@ -684,7 +684,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
} else if (touchMouseDevice == device && p.id() == touchMouseId) {
if (p.state() & Qt::TouchPointMoved) {
if (QQuickItem *mouseGrabberItem = q->mouseGrabberItem()) {
- QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event, mouseGrabberItem, false));
+ QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event.data(), mouseGrabberItem, false));
QCoreApplication::sendEvent(item, me.data());
event->setAccepted(me->isAccepted());
if (me->isAccepted()) {
@@ -695,7 +695,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
// no grabber, check if we care about mouse hover
// FIXME: this should only happen once, not recursively... I'll ignore it just ignore hover now.
// hover for touch???
- QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event, item, false));
+ QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseMove, p, event.data(), item, false));
if (lastMousePosition.isNull())
lastMousePosition = me->windowPos();
QPointF last = lastMousePosition;
@@ -713,7 +713,7 @@ bool QQuickWindowPrivate::deliverTouchAsMouse(QQuickItem *item, QQuickPointerEve
} else if (p.state() & Qt::TouchPointReleased) {
// currently handled point was released
if (QQuickItem *mouseGrabberItem = q->mouseGrabberItem()) {
- QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event, mouseGrabberItem, false));
+ QScopedPointer<QMouseEvent> me(touchToMouseEvent(QEvent::MouseButtonRelease, p, event.data(), mouseGrabberItem, false));
QCoreApplication::sendEvent(item, me.data());
if (item->acceptHoverEvents() && p.screenPos() != QGuiApplicationPrivate::lastCursorPosition) {
@@ -811,6 +811,10 @@ void QQuickWindowPrivate::grabTouchPoints(QQuickItem *grabber, const QVector<int
void QQuickWindowPrivate::removeGrabber(QQuickItem *grabber, bool mouse, bool touch)
{
Q_Q(QQuickWindow);
+ if (Q_LIKELY(mouse) && q->mouseGrabberItem() == grabber) {
+ qCDebug(DBG_MOUSE_TARGET) << "removeGrabber" << q->mouseGrabberItem() << "-> null";
+ setMouseGrabber(nullptr);
+ }
if (Q_LIKELY(touch)) {
const auto touchDevices = QQuickPointerDevice::touchDevices();
for (auto device : touchDevices) {
@@ -824,10 +828,6 @@ void QQuickWindowPrivate::removeGrabber(QQuickItem *grabber, bool mouse, bool to
}
}
}
- if (Q_LIKELY(mouse) && q->mouseGrabberItem() == grabber) {
- qCDebug(DBG_MOUSE_TARGET) << "removeGrabber" << q->mouseGrabberItem() << "-> null";
- setMouseGrabber(nullptr);
- }
}
/*!
@@ -4495,8 +4495,8 @@ QSGRendererInterface *QQuickWindow::rendererInterface() const
\note The call to the function must happen before constructing the first
QQuickWindow in the application. It cannot be changed afterwards.
- If \a backend is invalid or an error occurs, the default backend (OpenGL or
- software, depending on the Qt configuration) is used.
+ If the selected backend is invalid or an error occurs, the default backend
+ (OpenGL or software, depending on the Qt configuration) is used.
\since 5.8
*/
diff --git a/src/quick/scenegraph/qsgdefaultlayer.cpp b/src/quick/scenegraph/qsgdefaultlayer.cpp
index fc8040e67b..6fa9dd6359 100644
--- a/src/quick/scenegraph/qsgdefaultlayer.cpp
+++ b/src/quick/scenegraph/qsgdefaultlayer.cpp
@@ -44,6 +44,7 @@
#include <QtGui/QOpenGLFramebufferObject>
#include <QtGui/QOpenGLFunctions>
+#include <QtGui/private/qopenglextensions_p.h>
#include <QtQuick/private/qsgdepthstencilbuffer_p.h>
@@ -330,9 +331,9 @@ void QSGDefaultLayer::grab()
if (effectiveSamples <= 1) {
m_multisampling = false;
} else {
- const QSet<QByteArray> extensions = m_context->openglContext()->extensions();
- m_multisampling = extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_multisample"))
- && extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_blit"));
+ QOpenGLExtensions *e = static_cast<QOpenGLExtensions *>(funcs);
+ m_multisampling = e->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)
+ && e->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit);
}
m_multisamplingChecked = true;
}
diff --git a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
index 389b9e0b4e..9ffd1b4b08 100644
--- a/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
@@ -238,9 +238,9 @@ void QSGDefaultPainterNode::updateGeometry()
void QSGDefaultPainterNode::updateRenderTarget()
{
if (!m_extensionsChecked) {
- const QSet<QByteArray> extensions = m_context->openglContext()->extensions();
- m_multisamplingSupported = extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_multisample"))
- && extensions.contains(QByteArrayLiteral("GL_EXT_framebuffer_blit"));
+ QOpenGLExtensions *e = static_cast<QOpenGLExtensions *>(QOpenGLContext::currentContext()->functions());
+ m_multisamplingSupported = e->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)
+ && e->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit);
m_extensionsChecked = true;
}
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index 5dd16407b8..4aacb09c97 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -47,6 +47,7 @@
#if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl)
# include <private/qquickopenglshadereffectnode_p.h>
# include <private/qquickopenglshadereffect_p.h>
+# include <private/qquickshadereffect_p.h>
#endif
#include <private/qanimationgroupjob_p.h>
@@ -625,7 +626,8 @@ QQuickUniformAnimatorJob::QQuickUniformAnimatorJob()
void QQuickUniformAnimatorJob::setTarget(QQuickItem *target)
{
- if (qobject_cast<QQuickOpenGLShaderEffect *>(target) != nullptr)
+ QQuickShaderEffect* effect = qobject_cast<QQuickShaderEffect*>(target);
+ if (effect && effect->isOpenGLShaderEffect())
m_target = target;
}
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index 7788635e3e..a026abe762 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -151,6 +151,8 @@ QQuickTextureFactory *QQuickTextureFactory::textureFactoryForImage(const QImage
If you are using QRunnable as base for your QQuickImageResponse
ensure automatic deletion is disabled.
+ See the \l {imageresponseprovider}{Image Response Provider Example} for a complete implementation.
+
\sa QQuickImageProvider
*/
@@ -466,6 +468,8 @@ QQuickTextureFactory *QQuickImageProvider::requestTexture(const QString &id, QSi
\inmodule QtQuick
\brief The QQuickAsyncImageProvider class provides an interface for for asynchronous control of QML image requests.
+ See the \l {imageresponseprovider}{Image Response Provider Example} for a complete implementation.
+
\sa QQuickImageProvider
*/
QQuickAsyncImageProvider::QQuickAsyncImageProvider()