52 #include <QResizeEvent> 54 #include "graphicsView.hh" 68 QGraphicsView (_parent)
70 setFocusPolicy(Qt::StrongFocus);
71 setAcceptDrops (
true);
72 setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
73 setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
79 void GraphicsView::resizeEvent(QResizeEvent *_event) {
80 QGraphicsView::resizeEvent(_event);
84 scene()->setSceneRect(QRect(QPoint(0, 0), _event->size()));
85 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.