diff options
author | Liang Qi <liang.qi@qt.io> | 2016-06-29 10:11:24 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-29 10:11:25 +0200 |
commit | 5f2249f4dcce7523d8dc88b425b43834c4c3cab9 (patch) | |
tree | 5ddbd03806a0f940cca2d4de966c2a00d761717b /src/quick | |
parent | d5cb1bf4a9e19a0a4471ba5c935f441463a73414 (diff) | |
parent | 1b897195a14b63a553b139983736d8dfdd419ffd (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I70c0c672708522f7157849365cc53ee271d8e460
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc | 4 | ||||
-rw-r--r-- | src/quick/items/qquickitem.cpp | 4 | ||||
-rw-r--r-- | src/quick/items/qquicklistview.cpp | 8 | ||||
-rw-r--r-- | src/quick/items/qquickspriteengine.cpp | 9 | ||||
-rw-r--r-- | src/quick/items/qquickwindow_p.h | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 2 |
6 files changed, 22 insertions, 7 deletions
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/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 0ff04ce71c..5676bdb13a 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -5762,6 +5762,8 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible) QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window); if (windowPriv->mouseGrabberItem == q) q->ungrabMouse(); + if (!effectiveVisible) + q->ungrabTouchPoints(); } bool childVisibilityChanged = false; @@ -5810,6 +5812,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); diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp index 074af7ebdc..4b9b7df98a 100644 --- a/src/quick/items/qquicklistview.cpp +++ b/src/quick/items/qquicklistview.cpp @@ -3147,7 +3147,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; @@ -3170,6 +3170,7 @@ bool QQuickListViewPrivate::applyInsertionChange(const QQmlChangeSet::Change &ch if (!item) return false; + visibleAffected = true; visibleItems.insert(insertionIdx, item); if (insertionIdx == 0) insertResult->changedFirstItem = true; @@ -3201,6 +3202,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)))) @@ -3251,7 +3255,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) diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index 60d5e3f6dd..df044988e0 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -405,6 +405,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(); diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 1064be7178..9a768ab7dd 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -240,8 +240,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; diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 6572ceb2ce..25945ad78a 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -92,7 +92,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. |