From 5d23470b8d0bacb0e0ba074672f94e526cc9e456 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 1 Jun 2016 11:40:45 +0200 Subject: Report changes correctly when inserting into a ListView Commit v5.6.0-beta1~7 (ListView: Sanitize visibleItems list after model insertions, 2015-12-07) introduced sanitizing of the container of visibleItems, but it did not affect the return value of the QQuickListViewPrivate::applyInsertionChange function. The return value is used in QQuickItemViewPrivate::layout() to determine whether the layouting should proceed, or an early return is possible instead. If the layouting does not proceed, then the newly inserted visible items do not get painted, resulting in the linked bug. The return value of the QQuickListViewPrivate::applyInsertionChange function was previously determined by whether the new count of visible items is greater than the previous count. After the sanitation in commit v5.6.0-beta1~7, this numeric comparison is no longer a good indicator of whether a repaint is needed. Change the return value to indicate whether new items were inserted which are visible in a more-direct way. Verify that visible items are initialized correctly in tests. They should not be 'culled'. It is necessary to invoke the layout method first to clear the forceLayout state. Two pre-existing tests fail before the fix in this patch. Change-Id: I625f1e02bf7001834adb147161a1e478a0ce2a0d Task-number: QTBUG-53263 Reviewed-by: Robin Burchell --- src/quick/items/qquicklistview.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 78a64c5df1..b324e00cac 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -3117,7 +3117,7 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch } } - int prevVisibleCount = visibleItems.count(); + bool visibleAffected = false; if (insertResult->visiblePos.isValid() && pos < insertResult->visiblePos) { // Insert items before the visible item. int insertionIdx = index; @@ -3140,6 +3140,7 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch if (!item) return false; + visibleAffected = true; visibleItems.insert(insertionIdx, item); if (insertionIdx == 0) insertResult->changedFirstItem = true; @@ -3171,6 +3172,9 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch } else { qreal to = buffer + displayMarginEnd + tempPos + size(); + + visibleAffected = count > 0 && pos < to; + for (int i = 0; i < count && pos <= to; ++i) { FxViewItem *item = 0; if (change.isMove() && (item = currentChanges.removedItems.take(change.moveKey(modelIndex + i)))) @@ -3221,7 +3225,7 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch updateVisibleIndex(); - return visibleItems.count() > prevVisibleCount; + return visibleAffected; } void QQuickListViewPrivate::translateAndTransitionItemsAfter(int afterModelIndex, const ChangeResult &insertionResult, const ChangeResult &removalResult) -- cgit v1.2.3 From b61c774ce58d15bfc26a2a75b55e3f5eefbcdcc2 Mon Sep 17 00:00:00 2001 From: Daniel d'Andrada Date: Wed, 8 Jun 2016 14:42:03 -0300 Subject: QQuickSpriteEngine: avoid entering infinite loop in assembledImage() Do not allow a frame size larger than the image size, otherwise we would never leave "while (framesLeft > 0) {...}" as framesLeft is never decremented because "copied/frameWidth" in the expression "framesLeft -= copied/frameWidth;" always resolves to zero because copied < frameWidth. Task-number: QTBUG-53937 Change-Id: Ia777ec65d72562426b13533918efcaca5bcabdd7 Reviewed-by: Albert Astals Cid Reviewed-by: Shawn Rutledge Reviewed-by: Andy Nichols --- src/quick/items/qquickspriteengine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/quick') diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index 243feef683..864f632e7c 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -399,6 +399,15 @@ QImage QQuickSpriteEngine::assembledImage() QImage img = state->m_pix.image(); + { + const QSize frameSize(state->m_frameWidth, state->m_frameHeight); + if (!(img.size() - frameSize).isValid()) { + qmlInfo(state).nospace() << "SpriteEngine: Invalid frame size " << frameSize << "." + " It's bigger than image size " << img.size() << "."; + return QImage(); + } + } + //Check that the frame sizes are the same within one sprite if (!state->m_frameWidth) state->m_frameWidth = img.width() / state->frames(); -- cgit v1.2.3 From fb15206453faa8db26feb197dac3d16a8d6dfa1b Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 21 Jun 2016 13:40:15 +0200 Subject: ungrab touch points if the MultiPointTouchArea is hidden or disabled This caused MPTA to not emit onCanceled and caused the touch points 'pressed' property to not become 'false' after the MPTA was hidden or disabled. We now ungrab the touch points where we already ungrabbed the mouse. Change-Id: I90a5d4fa4b3fa470b8b60881c80418e79061f001 Task-number: QTBUG-42928 Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quick') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index d0f5f162fc..1c7a556540 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -5715,6 +5715,8 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible) QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window); if (windowPriv->mouseGrabberItem == q) q->ungrabMouse(); + if (!effectiveVisible) + q->ungrabTouchPoints(); } bool childVisibilityChanged = false; @@ -5763,6 +5765,8 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window); if (windowPriv->mouseGrabberItem == q) q->ungrabMouse(); + if (!effectiveEnable) + q->ungrabTouchPoints(); if (scope && !effectiveEnable && activeFocus) { windowPriv->clearFocusInScope( scope, q, Qt::OtherFocusReason, QQuickWindowPrivate::DontChangeFocusProperty | QQuickWindowPrivate::DontChangeSubFocusItem); -- cgit v1.2.3 From 6c16a50a51c1bafad71ab48c19ce98d57c005d25 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 21 Jun 2016 09:45:06 +0200 Subject: Rename qt.scenegraph.info to qt.scenegraph.general If configured with logging rules (QT_LOGGING_RULES=), qt.scenegraph.info=true will be interpreted as enabling QtInfoMsg for the qt.scenegraph category and subcategories. [ChangeLog][QtQuick] qt.scenegraph.info logging category got renamed to qt.scenegraph.general. Task-number: QTBUG-54238 Change-Id: I7601e522697c3b4b00b6e9866b803d91f72e76fc Reviewed-by: Gunnar Sletta Reviewed-by: Shawn Rutledge --- src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 4 ++-- src/quick/scenegraph/qsgcontext.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/quick') diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc index 516630d034..caedd72dc5 100644 --- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc +++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc @@ -180,7 +180,7 @@ dedicated thread. Qt attempts to choose a suitable loop based on the platform and possibly the graphics drivers in use. When this is not satisfactory, or for testing purposes, the environment variable \c QSG_RENDER_LOOP can be used to force the usage of a given loop. To -verify which render loop is in use, enable the \c qt.scenegraph.info +verify which render loop is in use, enable the \c qt.scenegraph.general \l {QLoggingCategory}{logging category}. \note The \c threaded and \c windows render loops rely on the OpenGL @@ -368,7 +368,7 @@ addition to being helpful to Qt contributors. \li \c {qt.scenegraph.time.glyph} - logs the time spent preparing distance field glyphs -\li \c {qt.scenegraph.info} - logs general information about various parts of the scene graph and the graphics stack +\li \c {qt.scenegraph.general} - logs general information about various parts of the scene graph and the graphics stack \li \c {qt.scenegraph.renderloop} - creates a detailed log of the various stages involved in rendering. This log mode is primarily useful for developers working on Qt. diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index dd6977e42e..be228e87c7 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE // Used for very high-level info about the renderering and gl context // Includes GL_VERSION, type of render loop, atlas size, etc. -Q_LOGGING_CATEGORY(QSG_LOG_INFO, "qt.scenegraph.info") +Q_LOGGING_CATEGORY(QSG_LOG_INFO, "qt.scenegraph.general") // Used to debug the renderloop logic. Primarily useful for platform integrators // and when investigating the render loop logic. -- cgit v1.2.3 From 8d35bf976ea3283ef458dc40d6477013b9064583 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 22 Jun 2016 15:28:20 +0200 Subject: Remove misleading out of date comments in QQuickWindowPrivate Task-number: QTBUG-54133 Change-Id: I68e41c3d6c066745058db0c15984d680d6c05ee9 Reviewed-by: Andy Nichols --- src/quick/items/qquickwindow_p.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 787958ef86..33aa021d98 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -234,8 +234,6 @@ public: uint clearBeforeRendering : 1; - // Currently unused in the default implementation, as we're not stopping - // rendering when obscured as we should... uint persistentGLContext : 1; uint persistentSceneGraph : 1; -- cgit v1.2.3