diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-26 13:54:04 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-06-26 14:56:38 (GMT) |
commit | 7541247a025bf112716a752bc4d114303f2a77f8 (patch) | |
tree | d170ff340b8fe60f320eaab0f766784f0287912a /src/gui/graphicsview/qgraphicssceneindex.cpp | |
parent | eab949e2ec8f820a54826c1a837c8c8de07814ab (diff) | |
download | Qt-7541247a025bf112716a752bc4d114303f2a77f8.zip Qt-7541247a025bf112716a752bc4d114303f2a77f8.tar.gz Qt-7541247a025bf112716a752bc4d114303f2a77f8.tar.bz2 |
Proper handling of scene rect in QGraphicsScene(Index).
Reviewed-by: Andreas
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneindex.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicssceneindex.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp index 4eaed2b..88fb6b0 100644 --- a/src/gui/graphicsview/qgraphicssceneindex.cpp +++ b/src/gui/graphicsview/qgraphicssceneindex.cpp @@ -335,6 +335,10 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe QGraphicsSceneIndex::QGraphicsSceneIndex(QGraphicsScene *scene) : QObject(*new QGraphicsSceneIndexPrivate(scene), scene) { + if (scene) { + connect(scene, SIGNAL(sceneRectChanged(const QRectF&)), + this, SLOT(updateSceneRect(const QRectF&))); + } } /*! @@ -527,6 +531,18 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::estimateItems(const QPointF &point, \a order. */ + +/*! + Notifies the index that the scene's scene rect has changed. \a rect + is thew new scene rect. + + \sa QGraphicsScene::sceneRect() +*/ +void QGraphicsSceneIndex::updateSceneRect(const QRectF &rect) +{ + Q_UNUSED(rect); +} + /*! This virtual function removes all items in the scene index. */ @@ -596,15 +612,6 @@ void QGraphicsSceneIndex::prepareBoundingRectChange(const QGraphicsItem *item) Q_UNUSED(item); } -/*! - This virtual function is called when the scene changes its bounding - rectangle. \a rect is the new value of the scene rectangle. - \sa QGraphicsScene::sceneRect() -*/ -void QGraphicsSceneIndex::sceneRectChanged() -{ -} - QT_END_NAMESPACE #include "moc_qgraphicssceneindex_p.cpp" |