diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-04-03 13:35:26 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-04-03 13:35:30 +0200 |
commit | 0eeb7ada04cc81d0ab1b61747bdf92fd7c33e1ec (patch) | |
tree | be4d0201b81b098a2976e857b5c6642f9c96e6ac /src/quick/util | |
parent | 349d3400c11c0ad1c9aaec01c44b174dbb6ebf9a (diff) | |
parent | e4894fe13d178b6aa8b5580b402df2d1b4f2615c (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: I0cbb2ba4a00580e6a74a4e4085fc4eb06d0fadae
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickanimatorjob.cpp | 7 | ||||
-rw-r--r-- | src/quick/util/qquickimageprovider.cpp | 18 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp index 5dd16407b8..89007cff1f 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> @@ -344,12 +345,13 @@ void QQuickTransformAnimatorJob::postSync() } 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_helper->node = d->itemNode(); } @@ -625,7 +627,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..0ceed7f681 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 */ @@ -181,7 +183,12 @@ QString QQuickImageResponse::errorString() const 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(). + A cancelled QQuickImageResponse still needs to emit finished() so that the + engine may clean up the QQuickImageResponse. + + \note finished() should not be emitted until the response is complete, + regardless of whether or not cancel() was called. If it is called prematurely, + the engine may destroy the response while it is still active, leading to a crash. */ void QQuickImageResponse::cancel() { @@ -190,7 +197,12 @@ void QQuickImageResponse::cancel() /*! \fn void QQuickImageResponse::finished() - Signals that the job execution has finished (be it successfully, because an error happened or because it was cancelled). + Signals that the job execution has finished (be it successfully, because an + error happened or because it was cancelled). + + \note Emission of this signal must be the final action the response performs: + once the signal is received, the response will subsequently be destroyed by + the engine. */ /*! @@ -466,6 +478,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() |