diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-24 08:57:40 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-24 09:15:57 +0200 |
commit | b254bbb82b7d1b42950c4267d8e618b570f88cc6 (patch) | |
tree | c8f9fd1fcbd5c5d4a75ffea79ee623ce59e9ae9b /src/quick | |
parent | 1b0e6861ba7af231c29ebba10c93976845f7f78d (diff) | |
parent | 5b8a94eb8e5d4e3b79ab73a9a0325f838ecbe41a (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I0127f2c16de1d930bdd8cbccd42ec6785f31ab96
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc | 4 | ||||
-rw-r--r-- | src/quick/items/context2d/qquickcontext2d.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickevents.cpp | 10 | ||||
-rw-r--r-- | src/quick/items/qquickitem.cpp | 5 |
4 files changed, 10 insertions, 11 deletions
diff --git a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc index b22b013684..30aca38678 100644 --- a/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc +++ b/src/quick/doc/src/guidelines/qtquick-bestpractices.qdoc @@ -318,8 +318,8 @@ component loaded by the engine. Context properties are useful for objects that must be available as soon as the QML is loaded and cannot be instantiated in QML. -\l {Integrating QML and C++} demonstrates an alternative approach where QML is -made aware of a C++ type so that it can instantiate it itself. +For a quick guide to choosing the correct approach to expose C++ types to QML, +see \l {Choosing the Correct Integration Method Between C++ and QML}. \section2 Related Information \list diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index e01e87b45a..07d5f6d39b 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -1637,7 +1637,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createRadialGradient(const QV4::Scoped<QQuickContext2DStyle> gradient(scope, scope.engine->memoryManager->allocate<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), r1, QPointF(x0, y0), r0); RETURN_RESULT(*gradient); } diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index d964f2bb32..d020ad7c4c 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -849,14 +849,16 @@ void QQuickEventPoint::setGrabberItem(QQuickItem *grabber) qCDebug(lcPointerGrab) << pointDeviceName(this) << "point" << hex << m_pointId << pointStateString(this) << ": grab" << m_exclusiveGrabber << "->" << grabber; } + QQuickItem *oldGrabberItem = grabberItem(); m_exclusiveGrabber = QPointer<QObject>(grabber); m_grabberIsHandler = false; m_sceneGrabPos = m_scenePos; - QQuickItem *oldGrabberItem = grabberItem(); - if (oldGrabberHandler) + if (oldGrabberHandler) { oldGrabberHandler->onGrabChanged(oldGrabberHandler, (grabber ? CancelGrabExclusive : UngrabExclusive), this); - else if (oldGrabberItem && oldGrabberItem != grabber && grabber && pointerEvent()->asPointerTouchEvent()) - oldGrabberItem->touchUngrabEvent(); + } else if (oldGrabberItem && oldGrabberItem != grabber && grabber && grabber->window()) { + QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(grabber->window()); + windowPriv->sendUngrabEvent(oldGrabberItem, windowPriv->isDeliveringTouchAsMouse()); + } for (QPointer<QQuickPointerHandler> passiveGrabber : m_passiveGrabbers) passiveGrabber->onGrabChanged(passiveGrabber, OverrideGrabPassive, this); } diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index f02ad24c5b..73fc12babd 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -7462,11 +7462,8 @@ void QQuickItem::grabMouse() auto point = fromTouch ? windowPriv->pointerEventInstance(windowPriv->touchMouseDevice)->pointById(windowPriv->touchMouseId) : windowPriv->pointerEventInstance(QQuickPointerDevice::genericMouseDevice())->point(0); - if (point) { - QQuickItem *oldGrabber = point->grabberItem(); + if (point) point->setGrabberItem(this); - windowPriv->sendUngrabEvent(oldGrabber, fromTouch); - } } /*! |