summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-04-21 21:03:06 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-04-21 21:03:06 (GMT)
commitdb4e2a600c53ad857d7fa3f7d84ac995215ecf93 (patch)
tree88ca89842925080cf18eb9f796310a89216828b0 /src/gui/graphicsview
parent4f64ff3e8902529700336c7ad3aa9fccf5ca3e0b (diff)
parentc36ff16f66ffd65839ba1e254ac557e491db6bf4 (diff)
downloadQt-db4e2a600c53ad857d7fa3f7d84ac995215ecf93.zip
Qt-db4e2a600c53ad857d7fa3f7d84ac995215ecf93.tar.gz
Qt-db4e2a600c53ad857d7fa3f7d84ac995215ecf93.tar.bz2
Merge branch '4.5'
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp14
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp4
2 files changed, 16 insertions, 2 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);
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index d9e0eec..69e08d1 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -4945,9 +4945,11 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
if (newCacheIndent != deviceData->cacheIndent || deviceRect.size() != pix.size()) {
QPoint diff = newCacheIndent - deviceData->cacheIndent;
QPixmap newPix(deviceRect.size());
+ // ### Investigate removing this fill (test with Plasma and
+ // graphicssystem raster).
+ newPix.fill(Qt::transparent);
if (!pix.isNull()) {
QPainter newPixPainter(&newPix);
- newPixPainter.setCompositionMode(QPainter::CompositionMode_Source);
newPixPainter.drawPixmap(-diff, pix);
newPixPainter.end();
}