diff options
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3aa74f3..8a7a080 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -4002,11 +4002,18 @@ bool QGraphicsItemPrivate::isProxyWidget() const */ void QGraphicsItem::update(const QRectF &rect) { - if ((rect.isEmpty() && !rect.isNull()) || d_ptr->discardUpdateRequest()) + if (rect.isEmpty() && !rect.isNull()) return; if (CacheMode(d_ptr->cacheMode) != NoCache) { QGraphicsItemCache *cache = d_ptr->extraItemCache(); + if (d_ptr->discardUpdateRequest(/* ignoreVisibleBit = */ false, + /* ignoreClipping = */ false, + /* ignoreDirtyBit = */ true)) { + return; + } + + // Invalidate cache. if (!cache->allExposed) { if (rect.isNull()) { cache->allExposed = true; @@ -4015,6 +4022,11 @@ void QGraphicsItem::update(const QRectF &rect) cache->exposed.append(rect); } } + // Only invalidate cache; item is already dirty. + if (d_ptr->dirty) + return; + } else if (d_ptr->discardUpdateRequest()) { + return; } // Effectively the same as updateHelper(rect); |