summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-10 18:29:18 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-10 18:29:18 (GMT)
commit570105f2b16fe38109485313103c9278612b965d (patch)
tree9f45e6d848c090d294faed672a36bd3a11e5a9d8 /src/declarative
parent5173a42be2d0121c0f33217cc4d8399070a8aa3b (diff)
downloadQt-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.cpp6
-rw-r--r--src/declarative/canvas/qsimplecanvas_p.h1
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;