46 #include <QResizeEvent> 48 #include "graphicsView.hh" 62 QGraphicsView (_parent)
64 setFocusPolicy(Qt::StrongFocus);
65 setAcceptDrops (
true);
66 setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
67 setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
73 void GraphicsView::resizeEvent(QResizeEvent *_event) {
74 QGraphicsView::resizeEvent(_event);
78 scene()->setSceneRect(QRect(QPoint(0, 0), _event->size()));
79 emit
sceneRectChanged (QRectF (0, 0, _event->size().width(),_event->size().height()));
GraphicsView(QWidget *_parent=NULL)
Constructor.
void sceneRectChanged(const QRectF &rect)
Inform the scene about size changes.