diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-10 18:29:18 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-10 18:29:18 (GMT) |
commit | 570105f2b16fe38109485313103c9278612b965d (patch) | |
tree | 9f45e6d848c090d294faed672a36bd3a11e5a9d8 /src/declarative | |
parent | 5173a42be2d0121c0f33217cc4d8399070a8aa3b (diff) | |
download | Qt-570105f2b16fe38109485313103c9278612b965d.zip Qt-570105f2b16fe38109485313103c9278612b965d.tar.gz Qt-570105f2b16fe38109485313103c9278612b965d.tar.bz2 |
Set scene rect to avoid updating growing items bounding rect.
Scroll bars are never in use, and all margins are set to 0 and there's
no frame, so we can safely set the scene rect to be the same as the view's rect.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/canvas/qsimplecanvas_graphicsview.cpp | 6 | ||||
-rw-r--r-- | src/declarative/canvas/qsimplecanvas_p.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/declarative/canvas/qsimplecanvas_graphicsview.cpp b/src/declarative/canvas/qsimplecanvas_graphicsview.cpp index dd4012b..d9ff39b 100644 --- a/src/declarative/canvas/qsimplecanvas_graphicsview.cpp +++ b/src/declarative/canvas/qsimplecanvas_graphicsview.cpp @@ -64,6 +64,12 @@ QSimpleCanvasGraphicsView::~QSimpleCanvasGraphicsView() sceneMap.remove(&_scene); } +void QSimpleCanvasGraphicsView::resizeEvent(QResizeEvent *e) +{ + _scene.setSceneRect(QRect(QPoint(0, 0), e->size())); + QGraphicsView::resizeEvent(e); +} + QSimpleGraphicsItem::QSimpleGraphicsItem(QSimpleCanvasItem *canvasItem) : /*scene(0),*/ owner(canvasItem) { diff --git a/src/declarative/canvas/qsimplecanvas_p.h b/src/declarative/canvas/qsimplecanvas_p.h index c900ccf..c2b5130 100644 --- a/src/declarative/canvas/qsimplecanvas_p.h +++ b/src/declarative/canvas/qsimplecanvas_p.h @@ -98,6 +98,7 @@ public: protected: virtual void paintEvent(QPaintEvent *); virtual void focusInEvent(QFocusEvent *); + virtual void resizeEvent(QResizeEvent *); private: QSimpleCanvasPrivate *canvas; |