diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-10-11 09:54:18 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2019-10-11 09:54:18 +0200 |
commit | aa268cae8df5a65106a48c0764b31118d8bf5f1e (patch) | |
tree | e1564d7bc3c6b8233d334e0ac41641da242a1839 /src | |
parent | bbc5e0f2d25618b1e170b5f92fda3089e5f3965a (diff) | |
parent | 6ec54900daf5290c6f147f1d539f3408bf78cf33 (diff) |
Merge 5.13 into 5.13.2
Change-Id: Ib1a7bdda1cde721efb356b2d043b26e2db7386ae
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/testlib/TestCase.qml | 2 | ||||
-rw-r--r-- | src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp | 2 | ||||
-rw-r--r-- | src/plugins/scenegraph/openvg/qsgopenvginternalrectanglenode.cpp | 17 | ||||
-rw-r--r-- | src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp | 1 | ||||
-rw-r--r-- | src/plugins/scenegraph/openvg/qsgopenvgspritenode.cpp | 2 | ||||
-rw-r--r-- | src/plugins/scenegraph/openvg/qsgopenvgspritenode.h | 2 | ||||
-rw-r--r-- | src/qml/doc/src/javascript/imports.qdoc | 7 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 25 | ||||
-rw-r--r-- | src/quick/items/qquickimage.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 17 | ||||
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 7 | ||||
-rw-r--r-- | src/quick/items/qquickrendercontrol.cpp | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode.cpp | 5 | ||||
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h | 3 |
14 files changed, 63 insertions, 32 deletions
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index e7669fd03d..6e075d8792 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -1631,7 +1631,7 @@ Item { TestCase { name: "ItemTests" - when: area.pressed + when: windowShown id: test1 function test_touch() { diff --git a/src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp b/src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp index 76ebb7c4ee..e4acda1ffd 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp @@ -72,6 +72,7 @@ void QSGOpenVGRenderContext::initialize(void *context) { m_vgContext = static_cast<QOpenVGContext*>(context); QSGRenderContext::initialize(context); + emit initialized(); } void QSGOpenVGRenderContext::invalidate() @@ -80,6 +81,7 @@ void QSGOpenVGRenderContext::invalidate() delete m_glyphCacheManager; m_glyphCacheManager = nullptr; QSGRenderContext::invalidate(); + emit invalidated(); } void QSGOpenVGRenderContext::renderNextFrame(QSGRenderer *renderer, uint fboId) diff --git a/src/plugins/scenegraph/openvg/qsgopenvginternalrectanglenode.cpp b/src/plugins/scenegraph/openvg/qsgopenvginternalrectanglenode.cpp index d728686248..2c71c1610a 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvginternalrectanglenode.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvginternalrectanglenode.cpp @@ -211,21 +211,14 @@ void QSGOpenVGInternalRectangleNode::render() } else { vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); vgLoadIdentity(); - if (m_radius > 0) { - // Fallback to rendering to an image for rounded rects with perspective transforms - if (m_offscreenSurface == nullptr || m_offscreenSurface->size() != QSize(std::ceil(m_rect.width()), std::ceil(m_rect.height()))) { - delete m_offscreenSurface; - m_offscreenSurface = new QOpenVGOffscreenSurface(QSize(std::ceil(m_rect.width()), std::ceil(m_rect.height()))); - } - - m_offscreenSurface->makeCurrent(); - } else if (m_offscreenSurface) { + // Fallback to rendering to an image for rounded rects with perspective transforms + if (m_offscreenSurface == nullptr || m_offscreenSurface->size() != QSize(std::ceil(m_rect.width()), std::ceil(m_rect.height()))) { delete m_offscreenSurface; - m_offscreenSurface = nullptr; + m_offscreenSurface = new QOpenVGOffscreenSurface(QSize(std::ceil(m_rect.width()), std::ceil(m_rect.height()))); } + m_offscreenSurface->makeCurrent(); } - // If path is dirty if (m_pathDirty) { vgClearPath(m_rectanglePath, VG_PATH_CAPABILITY_APPEND_TO); @@ -291,7 +284,7 @@ void QSGOpenVGInternalRectangleNode::render() vgDrawPath(m_rectanglePath, VG_FILL_PATH); } - if (!transform().isAffine() && m_radius > 0) { + if (!transform().isAffine()) { m_offscreenSurface->doneCurrent(); // Render offscreen surface vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); diff --git a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp index c41dfd7400..994ac251e3 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp @@ -185,6 +185,7 @@ void QSGOpenVGRenderLoop::renderWindow(QQuickWindow *window) data.updatePending = false; if (!data.grabOnly) { + cd->flushFrameSynchronousEvents(); // Event delivery/processing triggered the window to be deleted or stop rendering. if (!m_windows.contains(window)) return; diff --git a/src/plugins/scenegraph/openvg/qsgopenvgspritenode.cpp b/src/plugins/scenegraph/openvg/qsgopenvgspritenode.cpp index fb24df7471..1b75d450aa 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgspritenode.cpp +++ b/src/plugins/scenegraph/openvg/qsgopenvgspritenode.cpp @@ -52,7 +52,7 @@ QSGOpenVGSpriteNode::QSGOpenVGSpriteNode() QSGOpenVGSpriteNode::~QSGOpenVGSpriteNode() { - + delete m_texture; } void QSGOpenVGSpriteNode::setTexture(QSGTexture *texture) diff --git a/src/plugins/scenegraph/openvg/qsgopenvgspritenode.h b/src/plugins/scenegraph/openvg/qsgopenvgspritenode.h index d47b389a0b..dba4e663be 100644 --- a/src/plugins/scenegraph/openvg/qsgopenvgspritenode.h +++ b/src/plugins/scenegraph/openvg/qsgopenvgspritenode.h @@ -66,7 +66,7 @@ public: void render() override; private: - QSGOpenVGTexture *m_texture; + QSGOpenVGTexture *m_texture = nullptr; float m_time; QPoint m_sourceA; QPoint m_sourceB; diff --git a/src/qml/doc/src/javascript/imports.qdoc b/src/qml/doc/src/javascript/imports.qdoc index 974f2e154f..8e26c4aadd 100644 --- a/src/qml/doc/src/javascript/imports.qdoc +++ b/src/qml/doc/src/javascript/imports.qdoc @@ -144,14 +144,17 @@ A JavaScript resource may import a QML module in the following fashion: .import TypeNamespace MajorVersion.MinorVersion as Qualifier \endcode -For example: +Below you can see an example that also shows how to use the QML types from a +module imported in javascript: + \code .import Qt.test 1.0 as JsQtTest + +var importedEnumValue = JsQtTest.MyQmlObject.EnumValue3 \endcode In particular, this may be useful in order to access functionality provided via a singleton type; see qmlRegisterSingletonType() for more information. \note The .import syntax doesn't work for scripts used in the \l {WorkerScript} - */ diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 21c6a5d06b..e313ebe300 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -296,13 +296,28 @@ static double MakeDay(double year, double month, double day) if (month < 0) month += 12.0; - double d = DayFromYear(year); - bool leap = InLeapYear(d*msPerDay); + /* Quoting the spec: - d += DayFromMonth(month, leap); - d += day - 1; + Find a value t such that YearFromTime(t) is ym and MonthFromTime(t) is mn + and DateFromTime(t) is 1; but if this is not possible (because some + argument is out of range), return NaN. + */ + double first = DayFromYear(year); + /* Beware floating-point glitches: don't test the first millisecond of a + * year, month or day when we could test a moment firmly in the interior of + * the interval. A rounding glitch might give the first millisecond to the + * preceding interval. + */ + bool leap = InLeapYear((first + 60) * msPerDay); - return d; + first += DayFromMonth(month, leap); + const double t = first * msPerDay + msPerDay / 2; // Noon on the first of the month + Q_ASSERT(Day(t) == first); + if (YearFromTime(t) != year || MonthFromTime(t) != month || DateFromTime(t) != 1) { + qWarning("Apparently out-of-range date %.0f-%02.0f-%02.0f", year, month, day); + return qt_qnan(); + } + return first + day - 1; } static inline double MakeDate(double day, double time) diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp index 4a0936b4d5..16343774e2 100644 --- a/src/quick/items/qquickimage.cpp +++ b/src/quick/items/qquickimage.cpp @@ -676,13 +676,13 @@ QSGNode *QQuickImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) int xOffset = 0; if (d->hAlign == QQuickImage::AlignHCenter) - xOffset = qCeil((width() - pixWidth) / 2.); + xOffset = (width() - pixWidth) / 2; else if (d->hAlign == QQuickImage::AlignRight) xOffset = qCeil(width() - pixWidth); int yOffset = 0; if (d->vAlign == QQuickImage::AlignVCenter) - yOffset = qCeil((height() - pixHeight) / 2.); + yOffset = (height() - pixHeight) / 2; else if (d->vAlign == QQuickImage::AlignBottom) yOffset = qCeil(height() - pixHeight); diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index bbfbf6244c..b37fb69fae 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -599,6 +599,7 @@ void QQuickItemView::setHighlightRangeMode(HighlightRangeMode mode) d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd; if (isComponentComplete()) { d->updateViewport(); + d->moveReason = QQuickItemViewPrivate::Other; d->fixupPosition(); } emit highlightRangeModeChanged(); @@ -621,8 +622,10 @@ void QQuickItemView::setPreferredHighlightBegin(qreal start) d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd; if (isComponentComplete()) { d->updateViewport(); - if (!isMoving() && !isFlicking()) + if (!isMoving() && !isFlicking()) { + d->moveReason = QQuickItemViewPrivate::Other; d->fixupPosition(); + } } emit preferredHighlightBeginChanged(); } @@ -636,8 +639,10 @@ void QQuickItemView::resetPreferredHighlightBegin() d->highlightRangeStart = 0; if (isComponentComplete()) { d->updateViewport(); - if (!isMoving() && !isFlicking()) + if (!isMoving() && !isFlicking()) { + d->moveReason = QQuickItemViewPrivate::Other; d->fixupPosition(); + } } emit preferredHighlightBeginChanged(); } @@ -658,8 +663,10 @@ void QQuickItemView::setPreferredHighlightEnd(qreal end) d->haveHighlightRange = d->highlightRange != NoHighlightRange && d->highlightRangeStart <= d->highlightRangeEnd; if (isComponentComplete()) { d->updateViewport(); - if (!isMoving() && !isFlicking()) + if (!isMoving() && !isFlicking()) { + d->moveReason = QQuickItemViewPrivate::Other; d->fixupPosition(); + } } emit preferredHighlightEndChanged(); } @@ -673,8 +680,10 @@ void QQuickItemView::resetPreferredHighlightEnd() d->highlightRangeEnd = 0; if (isComponentComplete()) { d->updateViewport(); - if (!isMoving() && !isFlicking()) + if (!isMoving() && !isFlicking()) { + d->moveReason = QQuickItemViewPrivate::Other; d->fixupPosition(); + } } emit preferredHighlightEndChanged(); } diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index e4480b335a..8abb3f29cd 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1680,11 +1680,12 @@ void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event) return; } - - if (tl.isActive() && flicking && flickDuration && qreal(tl.time())/flickDuration < 0.8) + if (tl.isActive() && flicking && flickDuration && qreal(tl.time()) / flickDuration < 0.8) { stealMouse = true; // If we've been flicked then steal the click. - else + q->grabMouse(); // grab it right now too, just to be sure (QTBUG-77173) + } else { stealMouse = false; + } q->setKeepMouseGrab(stealMouse); timer.start(); diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp index f6d4e7ed49..76bcae1003 100644 --- a/src/quick/items/qquickrendercontrol.cpp +++ b/src/quick/items/qquickrendercontrol.cpp @@ -265,6 +265,7 @@ void QQuickRenderControl::polishItems() if (!d->window) return; cd->polishItems(); + emit d->window->afterAnimating(); } /*! diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode.cpp index d4e5e98d68..17e8bdc2f9 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode.cpp @@ -49,6 +49,11 @@ QSGSoftwareSpriteNode::QSGSoftwareSpriteNode() setGeometry((QSGGeometry*)1); } +QSGSoftwareSpriteNode::~QSGSoftwareSpriteNode() +{ + delete m_texture; +} + void QSGSoftwareSpriteNode::setTexture(QSGTexture *texture) { m_texture = qobject_cast<QSGSoftwarePixmapTexture*>(texture); diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h index 577a30c051..4015537395 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarespritenode_p.h @@ -64,6 +64,7 @@ class QSGSoftwareSpriteNode : public QSGSpriteNode { public: QSGSoftwareSpriteNode(); + ~QSGSoftwareSpriteNode() override; void setTexture(QSGTexture *texture) override; void setTime(float time) override; @@ -81,7 +82,7 @@ public: private: - QSGSoftwarePixmapTexture *m_texture; + QSGSoftwarePixmapTexture *m_texture = nullptr; float m_time; QPoint m_sourceA; QPoint m_sourceB; |