diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-16 16:59:24 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-09-16 16:59:24 (GMT) |
commit | d0a173dd338240a9084b4a2e2e3521ed4402ecaf (patch) | |
tree | 3ab23d121fefcab0949711743a74816775c2b38d /src/gui | |
parent | 03d99f6d1deee349013e6aa233bbf69635a7a3df (diff) | |
parent | 6f64c1087245c0ae034bcd09ca7549a33df5a6c7 (diff) | |
download | Qt-d0a173dd338240a9084b4a2e2e3521ed4402ecaf.zip Qt-d0a173dd338240a9084b4a2e2e3521ed4402ecaf.tar.gz Qt-d0a173dd338240a9084b4a2e2e3521ed4402ecaf.tar.bz2 |
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-fire-team:
QGraphicsWidget::setLayoutDirection doesn't propagate to new children
Prevent unnecessary graphics item updates when graphics effect changes.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 36 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget.cpp | 6 |
2 files changed, 26 insertions, 16 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 0c218fc..9092593 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -5378,11 +5378,9 @@ void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively() { QGraphicsItemPrivate *itemPrivate = this; do { - if (itemPrivate->graphicsEffect) { + if (itemPrivate->graphicsEffect && !itemPrivate->updateDueToGraphicsEffect) { itemPrivate->notifyInvalidated = 1; - - if (!itemPrivate->updateDueToGraphicsEffect) - static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache(); + static_cast<QGraphicsItemEffectSourcePrivate *>(itemPrivate->graphicsEffect->d_func()->source->d_func())->invalidateCache(); } } while ((itemPrivate = itemPrivate->parent ? itemPrivate->parent->d_ptr.data() : 0)); } @@ -5690,21 +5688,27 @@ void QGraphicsItem::update(const QRectF &rect) d_ptr->invalidateParentGraphicsEffectsRecursively(); #endif //QT_NO_GRAPHICSEFFECT - if (CacheMode(d_ptr->cacheMode) != NoCache) { - // Invalidate cache. - QGraphicsItemCache *cache = d_ptr->extraItemCache(); - if (!cache->allExposed) { - if (rect.isNull()) { - cache->allExposed = true; - cache->exposed.clear(); - } else { - cache->exposed.append(rect); +#ifndef QT_NO_GRAPHICSEFFECT + if (!d_ptr->updateDueToGraphicsEffect) { +#endif + if (CacheMode(d_ptr->cacheMode) != NoCache) { + // Invalidate cache. + QGraphicsItemCache *cache = d_ptr->extraItemCache(); + if (!cache->allExposed) { + if (rect.isNull()) { + cache->allExposed = true; + cache->exposed.clear(); + } else { + cache->exposed.append(rect); + } } + // Only invalidate cache; item is already dirty. + if (d_ptr->fullUpdatePending) + return; } - // Only invalidate cache; item is already dirty. - if (d_ptr->fullUpdatePending) - return; +#ifndef QT_NO_GRAPHICSEFFECT } +#endif if (d_ptr->scene) d_ptr->scene->d_func()->markDirty(this, rect); diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 965b1b34..d3562fc 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -1173,6 +1173,12 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant & QApplication::sendEvent(this, &event); break; } + case ItemChildAddedChange: { + QGraphicsItem *child = qVariantValue<QGraphicsItem *>(value); + if (child->isWidget()) + static_cast<QGraphicsWidget *>(child)->d_func()->resolveLayoutDirection(); + break; + } default: break; } |