From 1ea17d70dcdbece5868a2d35417e0bfc66d68739 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 1 Sep 2015 18:29:43 -0700 Subject: Fix compilation with ICC on Windows QV4::Managed is not copyable and its default constructor is deleted. However, it and classes derived from it are exported, which on Windows means the compiler will instantiate all possible functions and add to the DLL. ICC on Windows, unlike MSVC, attempts to instantiate the default constructor of the derived classes (like CallContext) and then the build fails due to the deleted Managed() constructor. Instead, use V4_MANAGED to mark each and every managed class as non- default-constructible and non-copyable. Only one note: the V4_MANAGED macro in QV4::Managed itself takes different parameters, so it needs to be slightly different. Task-number: QTBUG-48063 Change-Id: I42e7ef1a481840699a8dffff140007c65a7a35db Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4managed_p.h | 10 ++++++++-- src/qml/jsruntime/qv4object_p.h | 3 +++ src/qml/qml/qqmlxmlhttprequest.cpp | 4 ---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 0fe5c7ee49..aa3e668eef 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -60,7 +60,7 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} #define V4_NEEDS_DESTROY static void destroy(QV4::Heap::Base *b) { static_cast(b)->~Data(); } -#define V4_MANAGED(DataClass, superClass) \ +#define V4_MANAGED_ITSELF(DataClass, superClass) \ public: \ Q_MANAGED_CHECK \ typedef QV4::Heap::DataClass Data; \ @@ -70,6 +70,12 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} V4_MANAGED_SIZE_TEST \ QV4::Heap::DataClass *d() const { return static_cast(m); } +#define V4_MANAGED(DataClass, superClass) \ + private: \ + DataClass() Q_DECL_EQ_DELETE; \ + Q_DISABLE_COPY(DataClass) \ + V4_MANAGED_ITSELF(DataClass, superClass) + #define Q_MANAGED_TYPE(type) \ public: \ enum { MyType = Type_##type }; @@ -125,7 +131,7 @@ const QV4::ManagedVTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(clas struct Q_QML_PRIVATE_EXPORT Managed : Value { - V4_MANAGED(Base, Managed) + V4_MANAGED_ITSELF(Base, Managed) enum { IsExecutionContext = false, IsString = false, diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 71a997e133..e2250b9f18 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -72,6 +72,9 @@ struct Object : Base { Data *d() const { return static_cast(m); } #define V4_OBJECT2(DataClass, superClass) \ + private: \ + DataClass() Q_DECL_EQ_DELETE; \ + Q_DISABLE_COPY(DataClass) \ public: \ Q_MANAGED_CHECK \ typedef QV4::Heap::DataClass Data; \ diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index 2a3ede6a22..5586bdbb50 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -324,10 +324,6 @@ struct Node : public Object static ReturnedValue create(ExecutionEngine *v4, NodeImpl *); bool isNull() const; - -private: - Node &operator=(const Node &); - Node(const Node &o); }; Heap::Node::Node(ExecutionEngine *engine, NodeImpl *data) -- cgit v1.2.3 From ca72f33db334a19dc103c8aa534149138c77334b Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 3 Sep 2015 16:23:05 +0200 Subject: Doc: corrected broken links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-43810 Change-Id: Ib47749f95c9ce9db7f2b97726c13ccb9550981e4 Reviewed-by: Topi Reiniö --- src/qml/doc/src/qtqml.qdoc | 2 -- src/qml/types/qqmlitemselectionmodel.qdoc | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc index 64d6bb9ac4..d4562bf543 100644 --- a/src/qml/doc/src/qtqml.qdoc +++ b/src/qml/doc/src/qtqml.qdoc @@ -140,8 +140,6 @@ Further information for writing QML applications: - essential information for application development with QML and Qt Quick \li \l{Qt Quick} - a module which provides a set of QML types and C++ classes for building user interfaces and applications with QML -\li \l{Qt QML Release Notes} - list of changes and - additions in the Qt QML module \endlist \section2 Reference diff --git a/src/qml/types/qqmlitemselectionmodel.qdoc b/src/qml/types/qqmlitemselectionmodel.qdoc index 185ffb5fa4..02919b388e 100644 --- a/src/qml/types/qqmlitemselectionmodel.qdoc +++ b/src/qml/types/qqmlitemselectionmodel.qdoc @@ -38,7 +38,7 @@ This page only enumerates the properties, methods, and signals available in QML. See \l QItemSelectionModel for the actual documentation of this class. - \sa ItemModels + \sa QItemSelectionModel, {Models and Views in Qt Quick} */ -- cgit v1.2.3 From 67fa94aee26a01a81f47ad3e2876f345b10aca44 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 26 Aug 2015 12:08:35 +0200 Subject: QQuickScreen: Use QPointer to guard QScreen reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't get any notification when the QScreen object is deleted, so the only thing we can do is guard it with a QPointer as it's done in QWindowPrivate. Change-Id: Icf0ba036ec27e70694807f3e66c744910a783185 Reviewed-by: Morten Johan Sørvig --- src/quick/items/qquickscreen_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickscreen_p.h b/src/quick/items/qquickscreen_p.h index 3d0f00b22c..266f7bfed8 100644 --- a/src/quick/items/qquickscreen_p.h +++ b/src/quick/items/qquickscreen_p.h @@ -102,7 +102,7 @@ protected Q_SLOTS: void screenChanged(QScreen*); private: - QScreen* m_screen; + QPointer m_screen; QQuickWindow* m_window; QQuickItem* m_attachee; Qt::ScreenOrientations m_updateMask; -- cgit v1.2.3 From 81dad6eb2b58314c10af2ba40abceab974c7e80f Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 9 Sep 2015 14:57:54 +0200 Subject: Document that modifying the globalObject of QQmlEngine is not supported Change-Id: I62feb04ae26b6988c6e392b27bd1c3b7f630fd57 Task-number: QTBUG-48175 Reviewed-by: Simon Hausmann --- src/qml/doc/src/javascript/qmlglobalobject.qdoc | 4 +++- src/qml/qml/qqmlengine.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qml/doc/src/javascript/qmlglobalobject.qdoc b/src/qml/doc/src/javascript/qmlglobalobject.qdoc index e37b35451c..57259ec27d 100644 --- a/src/qml/doc/src/javascript/qmlglobalobject.qdoc +++ b/src/qml/doc/src/javascript/qmlglobalobject.qdoc @@ -45,7 +45,9 @@ additional imports: \li \l{XMLHttpRequest}, DOMException: These objects implement a subset of the \l{http://www.w3.org/TR/XMLHttpRequest/}{W3C XMLHttpRequest specification}. \endlist - +\note The \l {QJSEngine::}{globalObject()} function cannot be used to modify +the global object of a \l QQmlEngine by setting properties on it +(via \l {QJSValue::}{setProperty()}). \keyword XMLHttpRequest \section1 XMLHttpRequest diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index ffc890a2cf..729bf8e03b 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -912,7 +912,7 @@ QQuickWorkerScriptEngine *QQmlEnginePrivate::getWorkerScriptEngine() Note that the \l {Qt Quick 1} version is called QDeclarativeEngine. - \sa QQmlComponent, QQmlContext + \sa QQmlComponent, QQmlContext, {QML Global Object} */ /*! -- cgit v1.2.3 From 1aa18624f92f1ec7f2f5715653732515fddcbb9e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 10 Sep 2015 14:38:48 +0200 Subject: Qt QML documentation: fix link that should be in list Change-Id: Ied44c63fab703db5188ec8f829363a4999f85560 Reviewed-by: Venugopal Shivashankar --- src/qml/doc/src/qtqml.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc index d4562bf543..33bb0c0750 100644 --- a/src/qml/doc/src/qtqml.qdoc +++ b/src/qml/doc/src/qtqml.qdoc @@ -106,8 +106,8 @@ JavaScript expressions allow QML code to contain application logic. Qt QML provides the framework for running JavaScript expressions in QML and from C++. These sections are from \l{The QML Reference}. -\l{qtqml-javascript-topic.html}{Integrating QML and JavaScript} \list + \li \l{qtqml-javascript-topic.html}{Integrating QML and JavaScript} \li \l{qtqml-javascript-expressions.html}{Using JavaScript Expressions with QML} \li \l{qtqml-javascript-dynamicobjectcreation.html}{Dynamic QML Object Creation from JavaScript} \li \l{qtqml-javascript-resources.html}{Defining JavaScript Resources In QML} -- cgit v1.2.3 From af0a53d89835baa86698b40ac845024ee49e71b1 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 9 Sep 2015 11:16:31 +0200 Subject: Make Image::layer::enabled work as expected. Change-Id: I0021ab5d3f51e47725cc0462ff74b6562d39c95b Task-number: QTBUG-48113 Reviewed-by: Michael Brasser --- src/quick/items/qquickimage.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index 3ba09f9cea..483d86c97d 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -551,6 +551,13 @@ QSGTextureProvider *QQuickImage::textureProvider() const { Q_D(const QQuickImage); + // When Item::layer::enabled == true, QQuickItem will be a texture + // provider. In this case we should prefer to return the layer rather + // than the image itself. The layer will include any children and any + // the image's wrap and fill mode. + if (QQuickItem::isTextureProvider()) + return QQuickItem::textureProvider(); + if (!d->window || !d->sceneGraphRenderContext() || QThread::currentThread() != d->sceneGraphRenderContext()->thread()) { qWarning("QQuickImage::textureProvider: can only be queried on the rendering thread of an exposed window"); return 0; -- cgit v1.2.3 From 8feca74deda0abca0bc1787e18d227c2a3d578e7 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 9 Sep 2015 11:22:37 +0200 Subject: Include doc note about Image::fillMode being excluded by shader. Change-Id: I8731ea81421e8f6cea7d59bea82030d0855b0054 Task-number: QTBUG-48113 Reviewed-by: Michael Brasser --- src/quick/items/qquickshadereffect.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 0be305b693..349207f145 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -578,8 +578,12 @@ void QQuickShaderEffectCommon::propertyChanged(QQuickItem *item, int mappedId, \li QTransform -> mat3 \li QMatrix4x4 -> mat4 \li QQuaternion -> vec4, scalar value is \c w. - \li \l Image, \l ShaderEffectSource -> sampler2D - Origin is in the top-left - corner, and the color values are premultiplied. + \li \l Image -> sampler2D - Origin is in the top-left corner, and the + color values are premultiplied. The texture is provided as is, + excluding the Image item's fillMode. To include fillMode, use a + ShaderEffectSource or Image::layer::enabled. + \li \l ShaderEffectSource -> sampler2D - Origin is in the top-left + corner, and the color values are premultiplied. \endlist The QML scene graph back-end may choose to allocate textures in texture -- cgit v1.2.3 From 001c47e75779b9b55adebdfc293c232d757d4a8e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 9 Sep 2015 11:23:37 +0200 Subject: Make Canvas::layer::enabled work Change-Id: I3e159ea6d02f415307db6d45470665085aaa023e Reviewed-by: Michael Brasser --- src/quick/items/context2d/qquickcanvasitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index 75507c68d2..6ef2d6123b 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -783,6 +783,12 @@ bool QQuickCanvasItem::isTextureProvider() const QSGTextureProvider *QQuickCanvasItem::textureProvider() const { + // When Item::layer::enabled == true, QQuickItem will be a texture + // provider. In this case we should prefer to return the layer rather + // than the canvas itself. + if (QQuickItem::isTextureProvider()) + return QQuickItem::textureProvider(); + Q_D(const QQuickCanvasItem); QQuickWindow *w = window(); if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) { -- cgit v1.2.3 From 219c80b3297ba5f5851152d2414d64b3b4e49676 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 9 Sep 2015 11:23:53 +0200 Subject: Make QQuickFramebufferObject::layer::enabled work Change-Id: I95c88fa9b2dbb4f482286e4a22b608fbc450fb2b Reviewed-by: Michael Brasser --- src/quick/items/qquickframebufferobject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index 6031315b90..4638bbbdf3 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -311,6 +311,12 @@ bool QQuickFramebufferObject::isTextureProvider() const */ QSGTextureProvider *QQuickFramebufferObject::textureProvider() const { + // When Item::layer::enabled == true, QQuickItem will be a texture + // provider. In this case we should prefer to return the layer rather + // than the fbo texture. + if (QQuickItem::isTextureProvider()) + return QQuickItem::textureProvider(); + Q_D(const QQuickFramebufferObject); QQuickWindow *w = window(); if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) { -- cgit v1.2.3 From 171f8fd1e3c4fb9944f3ecae7b3faaa0431e538a Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 10 Sep 2015 14:28:21 +0200 Subject: Link to JavaScript Environment Restrictions doc from Global Object docs I added the note to the global object documentation in 81dad6e, but I wasn't aware that a more detailed section existed elsewhere. Change-Id: I2b8c1c6ade0d9f27d489a246839ade89ee868a28 Reviewed-by: Venugopal Shivashankar --- src/qml/doc/src/javascript/qmlglobalobject.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/doc/src/javascript/qmlglobalobject.qdoc b/src/qml/doc/src/javascript/qmlglobalobject.qdoc index 57259ec27d..50374f4583 100644 --- a/src/qml/doc/src/javascript/qmlglobalobject.qdoc +++ b/src/qml/doc/src/javascript/qmlglobalobject.qdoc @@ -46,8 +46,8 @@ additional imports: \endlist \note The \l {QJSEngine::}{globalObject()} function cannot be used to modify -the global object of a \l QQmlEngine by setting properties on it -(via \l {QJSValue::}{setProperty()}). +the global object of a \l QQmlEngine. For more information about this, see +\l {JavaScript Environment Restrictions}. \keyword XMLHttpRequest \section1 XMLHttpRequest -- cgit v1.2.3 From f6531304db9267dcaa3b7897642aeadda5692100 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Sun, 13 Sep 2015 17:03:48 +0200 Subject: Fix QQmlComponent::beginCreate documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4ef2cfc83d308a017ef4a98eac94aac52c49d117 Reviewed-by: Topi Reiniö --- src/qml/qml/qqmlcomponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 9210610cec..669ed2337a 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -794,8 +794,8 @@ QObject *QQmlComponent::create(QQmlContext *context) /*! This method provides advanced control over component instance creation. - In general, programmers should use QQmlComponent::create() to create a - component. + In general, programmers should use QQmlComponent::create() to create object + instances. Create an object instance from this component. Returns 0 if creation failed. \a publicContext specifies the context within which to create the object -- cgit v1.2.3 From 28fd662272561b42ce5e479d214f09705a5bf55c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 27 Apr 2015 21:17:40 +0200 Subject: Revert "Avoid calling potentially pure virtual method" This reverts commit 2d34ed2e655d79bed95859f1d32c2abfacbfb6f1. This change was only needed in Qt 5.4 Change-Id: Ica636da9a3deba68abbfda12e5ea72b296d9ad64 Reviewed-by: Dmitry Shachnev Reviewed-by: Alan Alpert --- src/quick/items/qquickscreen.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index 3bf7229b33..5bd6430f2d 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -351,15 +351,24 @@ void QQuickScreenAttached::screenChanged(QScreen *screen) emit orientationUpdateMaskChanged(); } - emit widthChanged(); - emit heightChanged(); - emit nameChanged(); - emit orientationChanged(); - emit primaryOrientationChanged(); - emit desktopGeometryChanged(); - emit logicalPixelDensityChanged(); - emit pixelDensityChanged(); - emit devicePixelRatioChanged(); + if (!oldScreen || screen->size() != oldScreen->size()) { + emit widthChanged(); + emit heightChanged(); + } + if (!oldScreen || screen->name() != oldScreen->name()) + emit nameChanged(); + if (!oldScreen || screen->orientation() != oldScreen->orientation()) + emit orientationChanged(); + if (!oldScreen || screen->primaryOrientation() != oldScreen->primaryOrientation()) + emit primaryOrientationChanged(); + if (!oldScreen || screen->availableVirtualGeometry() != oldScreen->availableVirtualGeometry()) + emit desktopGeometryChanged(); + if (!oldScreen || screen->logicalDotsPerInch() != oldScreen->logicalDotsPerInch()) + emit logicalPixelDensityChanged(); + if (!oldScreen || screen->physicalDotsPerInch() != oldScreen->physicalDotsPerInch()) + emit pixelDensityChanged(); + if (!oldScreen || screen->devicePixelRatio() != oldScreen->devicePixelRatio()) + emit devicePixelRatioChanged(); connect(screen, SIGNAL(geometryChanged(QRect)), this, SIGNAL(widthChanged())); -- cgit v1.2.3 From 7c74c443362dd62f41b01b5e6eae705b93685935 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 18 Sep 2015 21:03:54 +0200 Subject: Fix grammar in Performance docs Change-Id: I3e012d1124973d9f33123f6b68acfeffeeedb018 Reviewed-by: Gunnar Sletta --- src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc index 8ef77dac4c..287bdc892e 100644 --- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc @@ -762,7 +762,7 @@ with multiple windows. faster to process in the renderer and faster to draw on the GPU. For instance, PNG files will often have an alpha channel, even though each pixel is fully opaque. JPG files are always opaque. When - providing images to an QQuickImageProvider or creating images with + providing images to a QQuickImageProvider or creating images with QQuickWindow::createTextureFromImage(), let the image have QImage::Format_RGB32, when possible. -- cgit v1.2.3 From 071b265e12a4996fcbbfc5874094256b094e44a2 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Mon, 21 Sep 2015 11:45:14 +0200 Subject: Fix compilation of QtDeclarative with QT_NO_GESTURES Allow to compile QtDeclarative module with QT_NO_GESTURES define enabled. Change-Id: I5335f97c675d75c71c81edcc8307338ed3571663 Reviewed-by: Alan Alpert --- src/quick/items/qquickitem.cpp | 2 ++ src/quick/items/qquickpincharea.cpp | 2 +- src/quick/items/qquickwindow.cpp | 4 ++++ src/quick/items/qquickwindow_p.h | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 5fd1882216..ac3f8b2433 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -7310,9 +7310,11 @@ bool QQuickItem::event(QEvent *ev) dropEvent(static_cast(ev)); break; #endif // QT_NO_DRAGANDDROP +#ifndef QT_NO_GESTURES case QEvent::NativeGesture: ev->ignore(); break; +#endif // QT_NO_GESTURES default: return QObject::event(ev); } diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp index 07bf268309..f419d570f3 100644 --- a/src/quick/items/qquickpincharea.cpp +++ b/src/quick/items/qquickpincharea.cpp @@ -765,11 +765,11 @@ bool QQuickPinchArea::event(QEvent *event) d->pinchRotation = angle; updatePinchTarget(); } break; -#endif // QT_NO_GESTURES default: return QQuickItem::event(event); } } break; +#endif // QT_NO_GESTURES case QEvent::Wheel: event->ignore(); return false; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 5958edf29f..76daa44225 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1400,9 +1400,11 @@ bool QQuickWindow::event(QEvent *e) d->windowManager->handleUpdateRequest(this); break; } +#ifndef QT_NO_GESTURES case QEvent::NativeGesture: d->deliverNativeGestureEvent(d->contentItem, static_cast(e)); break; +#endif default: break; } @@ -1779,6 +1781,7 @@ void QQuickWindow::wheelEvent(QWheelEvent *event) } #endif // QT_NO_WHEELEVENT +#ifndef QT_NO_GESTURES bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGestureEvent *event) { QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); @@ -1810,6 +1813,7 @@ bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGes return false; } +#endif // QT_NO_GESTURES bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event) { diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 605a36fb1d..b63143178b 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -145,7 +145,9 @@ public: #ifndef QT_NO_WHEELEVENT bool deliverWheelEvent(QQuickItem *, QWheelEvent *); #endif +#ifndef QT_NO_GESTURES bool deliverNativeGestureEvent(QQuickItem *, QNativeGestureEvent *); +#endif bool deliverTouchPoints(QQuickItem *, QTouchEvent *, const QList &, QSet *, QHash > *, QSet *filtered); void deliverTouchEvent(QTouchEvent *); -- cgit v1.2.3 From c63e7d36d43ffaba811971087bce1595a4aa9535 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 21 Sep 2015 15:14:13 +0200 Subject: Fix ViewTransition property type in documentation They were all documented as being lists. Change-Id: I95b843ed75dd922d9a3d8824e666a344688091c9 Reviewed-by: Venugopal Shivashankar --- src/quick/items/qquickitemviewtransition.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/quick/items/qquickitemviewtransition.cpp b/src/quick/items/qquickitemviewtransition.cpp index 7fa6cdc161..3218e3847c 100644 --- a/src/quick/items/qquickitemviewtransition.cpp +++ b/src/quick/items/qquickitemviewtransition.cpp @@ -850,7 +850,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent) */ /*! - \qmlattachedproperty list QtQuick::ViewTransition::index + \qmlattachedproperty int QtQuick::ViewTransition::index This attached property holds the index of the item that is being transitioned. @@ -860,7 +860,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent) */ /*! - \qmlattachedproperty list QtQuick::ViewTransition::item + \qmlattachedproperty item QtQuick::ViewTransition::item This attached property holds the item that is being transitioned. @@ -869,7 +869,7 @@ QQuickViewTransitionAttached::QQuickViewTransitionAttached(QObject *parent) */ /*! - \qmlattachedproperty list QtQuick::ViewTransition::destination + \qmlattachedproperty point QtQuick::ViewTransition::destination This attached property holds the final destination position for the transitioned item within the view. -- cgit v1.2.3 From b07d3823a9a688f7ff1142c4f94884975afb6fc7 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 22 Sep 2015 13:03:22 +0200 Subject: Don't try to render directly without context in showEvent Partially reverting db525935ccd64d2c5c674f8a66dbe7096d754e9f Task-number: QTCREATORBUG-15040 Change-Id: I6ced42a3d00bb1c419b2b0d4729bc4f5f3cf8bc7 Reviewed-by: Gunnar Sletta Reviewed-by: Laszlo Agocs --- src/quickwidgets/qquickwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index a848774ae9..e62cea514c 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -1072,7 +1072,10 @@ void QQuickWidget::showEvent(QShowEvent *) Q_D(QQuickWidget); d->updatePending = false; d->createContext(); - d->render(true); + if (d->offscreenWindow->openglContext()) + d->render(true); + else + triggerUpdate(); } /*! \reimp */ -- cgit v1.2.3 From 2cc7621c4b22d7356b60a06038e7bc6b7b13718e Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 22 Sep 2015 18:03:18 +0200 Subject: Assert that context exists in QQuickWidgetPrivate::render Task-number: QTCREATORBUG-15040 Change-Id: I401aec030840175efda2e2f0ec60569ce9c46b02 Reviewed-by: Gunnar Sletta --- src/quickwidgets/qquickwidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index e62cea514c..ef36bf51af 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -202,6 +202,8 @@ void QQuickWidgetPrivate::itemGeometryChanged(QQuickItem *resizeItem, const QRec void QQuickWidgetPrivate::render(bool needsSync) { + Q_ASSERT(context); + if (!context->makeCurrent(offscreenSurface)) { qWarning("QQuickWidget: Cannot render due to failing makeCurrent()"); return; -- cgit v1.2.3 From 9794e7d66c30f012a19ec9530d719293b7c5bc7c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 23 Sep 2015 10:03:21 +0200 Subject: Link to Item Layers documentation from each property of layer The layer properties desperately lack code snippets, but the Item Layers section has some, so link to that. Change-Id: I3172102b5a1f95bfc495242a16141f030db0dd3c Reviewed-by: Gunnar Sletta --- src/quick/items/qquickitem.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index ac3f8b2433..1b728584b4 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -7426,6 +7426,8 @@ QQuickItemLayer::~QQuickItemLayer() None of the other layer properties have any effect when the layer is disabled. + + \sa {Item Layers} */ void QQuickItemLayer::setEnabled(bool e) { @@ -7549,7 +7551,7 @@ void QQuickItemLayer::deactivateEffect() The effect is typically a \l ShaderEffect component, although any \l Item component can be assigned. The effect should have a source texture property with a name matching \l layer.samplerName. - \sa layer.samplerName + \sa layer.samplerName, {Item Layers} */ void QQuickItemLayer::setEffect(QQmlComponent *component) @@ -7589,6 +7591,8 @@ void QQuickItemLayer::setEffect(QQmlComponent *component) \note Some OpenGL ES 2 implementations do not support mipmapping of non-power-of-two textures. + + \sa {Item Layers} */ void QQuickItemLayer::setMipmap(bool mipmap) @@ -7622,6 +7626,7 @@ void QQuickItemLayer::setMipmap(bool mipmap) be used with caution, as support for these formats in the underlying hardare and driver is often not present. + \sa {Item Layers} */ void QQuickItemLayer::setFormat(QQuickShaderEffectSource::Format f) @@ -7644,6 +7649,8 @@ void QQuickItemLayer::setFormat(QQuickShaderEffectSource::Format f) rendered into the texture. The source rectangle can be larger than the item itself. If the rectangle is null, which is the default, then the whole item is rendered to the texture. + + \sa {Item Layers} */ void QQuickItemLayer::setSourceRect(const QRectF &sourceRect) @@ -7662,6 +7669,8 @@ void QQuickItemLayer::setSourceRect(const QRectF &sourceRect) \qmlproperty bool QtQuick::Item::layer.smooth Holds whether the layer is smoothly transformed. + + \sa {Item Layers} */ void QQuickItemLayer::setSmooth(bool s) @@ -7685,6 +7694,8 @@ void QQuickItemLayer::setSmooth(bool s) \note Some platforms have a limit on how small framebuffer objects can be, which means the actual texture size might be larger than the requested size. + + \sa {Item Layers} */ void QQuickItemLayer::setSize(const QSize &size) @@ -7715,6 +7726,8 @@ void QQuickItemLayer::setSize(const QSize &size) \note Some OpenGL ES 2 implementations do not support the GL_REPEAT wrap mode with non-power-of-two textures. + + \sa {Item Layers} */ void QQuickItemLayer::setWrapMode(QQuickShaderEffectSource::WrapMode mode) @@ -7737,7 +7750,7 @@ void QQuickItemLayer::setWrapMode(QQuickShaderEffectSource::WrapMode mode) This value must match the name of the effect's source texture property so that the Item can pass the layer's offscreen surface to the effect correctly. - \sa layer.effect, ShaderEffect + \sa layer.effect, ShaderEffect, {Item Layers} */ void QQuickItemLayer::setName(const QByteArray &name) { -- cgit v1.2.3 From 5f23d4eb103baa21225adb4c3dd666dbefef6515 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 24 Sep 2015 10:05:37 +0200 Subject: Image: fix crash when switching between multiple screens When moving a Qt Quick application containing Image delegates in a view (e.g. ListView, GridView, etc.) between multiple screens, it's possible that the amount of visible delegates changes due to potential differences in the screens' sizes. For example, moving an application using the Window + left/right arrow keys on Windows causes the window to snap to the side of the screen. If one screen is smaller than the other, moving the application back and forth in this manner will cause some delegates to be destroyed, as they are no longer visible in the smaller screen. However, between receiving the Component.destruction signal in QML and being actually destroyed in C++, the Images may try to reload their pixmaps (when the cache property is set to false, for example). Since the views had (correctly) already hidden those delegates and hence they had no associated QQmlEngine, the load() function would crash because of the assumption that there was a valid engine. This patch checks that there is a valid QQmlEngine with which to load pixmaps before doing so. Change-Id: I8a3f0ec5220fddfd79758985c1eb2b55b0baae47 Task-number: QTBUG-45991 Reviewed-by: Gunnar Sletta Reviewed-by: Simon Hausmann --- src/quick/items/qquickimagebase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp index 223cb8f46f..72325243df 100644 --- a/src/quick/items/qquickimagebase.cpp +++ b/src/quick/items/qquickimagebase.cpp @@ -308,7 +308,7 @@ void QQuickImageBase::itemChange(ItemChange change, const ItemChangeData &value) void QQuickImageBase::handleScreenChanged(QScreen* screen) { // Screen DPI might have changed, reload images on screen change. - if (screen && isComponentComplete()) + if (qmlEngine(this) && screen && isComponentComplete()) load(); } -- cgit v1.2.3 From ad125bd18ef5c98a264b9e4fac258dd07511035d Mon Sep 17 00:00:00 2001 From: Marcel Krems Date: Fri, 7 Aug 2015 01:50:38 +0200 Subject: Disable Clang warning -Wheader-hygiene. qqmlinfo.h:51:17: warning: using namespace directive in global context in header [-Wheader-hygiene] In this case the use of the using directive is intended. See also: 0181dc283f6a783783b7e622b4e2dc241edd8a54 Change-Id: I8f94cefdab7ce70e375ad8b01f59eb0f9d840708 Reviewed-by: Kai Koehne Reviewed-by: Alan Alpert --- src/qml/qml/qqmlinfo.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qml/qml/qqmlinfo.h b/src/qml/qml/qqmlinfo.h index b56f74198c..90ac1dd777 100644 --- a/src/qml/qml/qqmlinfo.h +++ b/src/qml/qml/qqmlinfo.h @@ -48,7 +48,11 @@ namespace QtQml { Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QQmlError &error); Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me, const QList &errors); } +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wheader-hygiene") +// This is necessary to allow for QtQuick1 and QtQuick2 scenes in a single application. using namespace QtQml; +QT_WARNING_POP class QQmlInfoPrivate; class Q_QML_EXPORT QQmlInfo : public QDebug -- cgit v1.2.3