diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-06-15 07:37:43 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-06-15 07:37:43 (GMT) |
commit | 6100dd1ccda7fce60625e99ffb2a90dc62cb1486 (patch) | |
tree | 7de5d72c227a163c3d042d8c04b8551176e4460a /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | 7b7f3869b15cee6f6815e10d49dcb8209a415edd (diff) | |
parent | 3a54e5ead647a318641d9a2bcf75eda4b8859d1b (diff) | |
download | Qt-6100dd1ccda7fce60625e99ffb2a90dc62cb1486.zip Qt-6100dd1ccda7fce60625e99ffb2a90dc62cb1486.tar.gz Qt-6100dd1ccda7fce60625e99ffb2a90dc62cb1486.tar.bz2 |
Merge remote branch 'origin/master'
Conflicts:
src/gui/painting/qpainter.cpp
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index d1f6eb3..6867410 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1427,12 +1427,14 @@ QGraphicsItem::~QGraphicsItem() d_ptr->inDestructor = 1; d_ptr->removeExtraItemCache(); +#ifndef QT_NO_GESTURES if (d_ptr->isObject && !d_ptr->gestureContext.isEmpty()) { QGraphicsObject *o = static_cast<QGraphicsObject *>(this); QGestureManager *manager = QGestureManager::instance(); foreach (Qt::GestureType type, d_ptr->gestureContext.keys()) manager->cleanupCachedGestures(o, type); } +#endif clearFocus(); @@ -5687,18 +5689,20 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect) return; } - // Find pixmap in cache, then remove to avoid deep copy when modifying.s + // Find pixmap in cache. QPixmap cachedPixmap; if (!QPixmapCache::find(cache->key, &cachedPixmap)) { update(rect); return; } - QPixmapCache::remove(cache->key); QRect scrollRect = (rect.isNull() ? boundingRect() : rect).toAlignedRect(); if (!scrollRect.intersects(cache->boundingRect)) return; // Nothing to scroll. + // Remove from cache to avoid deep copy when modifying. + QPixmapCache::remove(cache->key); + QRegion exposed; cachedPixmap.scroll(dx, dy, scrollRect.translated(-cache->boundingRect.topLeft()), &exposed); @@ -7569,6 +7573,7 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent QGraphicsItem::d_ptr->isObject = true; } +#ifndef QT_NO_GESTURES /*! Subscribes the graphics object to the given \a gesture with specific \a flags. @@ -7592,6 +7597,8 @@ void QGraphicsObject::ungrabGesture(Qt::GestureType gesture) if (QGraphicsItem::d_ptr->gestureContext.remove(gesture) && QGraphicsItem::d_ptr->scene) QGraphicsItem::d_ptr->scene->d_func()->ungrabGesture(this, gesture); } +#endif // QT_NO_GESTURES + /*! Updates the item's micro focus. This is slot for convenience. |