20 #include <QDragEnterEvent>
21 #include <QGraphicsScene>
22 #include <QGraphicsView>
25 #include <QVBoxLayout>
30 setRenderHint(QPainter::Antialiasing);
31 setMouseTracking(
true);
32 setDragMode(QGraphicsView::RubberBandDrag);
37 if (dragMode() == QGraphicsView::NoDrag) {
39 }
else if (dragMode() == QGraphicsView::RubberBandDrag) {
41 }
else if (dragMode() == QGraphicsView::ScrollHandDrag) {
52 setDragMode(QGraphicsView::NoDrag);
57 setDragMode(QGraphicsView::RubberBandDrag);
62 setDragMode(QGraphicsView::ScrollHandDrag);
63 setInteractive(
false);
74 centerOn(scene()->itemsBoundingRect().center());
79 QTransform oldMatrix = transform();
81 translate(oldMatrix.dx(), oldMatrix.dy());
82 scale(new_scale, new_scale);
94 switch (event->key()) {
105 case Qt::Key_Backspace:
109 QWidget::keyPressEvent(event);
115 switch (event->key()) {
123 QWidget::keyPressEvent(event);
Defines the macro ASSERT.
#define ASSERT(condition)
Defines class DesignerMimeData.
Defines class DesignerScene.
Defines class DesignerView.
Defines class GUIHelpers functions.
Main class which represents SessionModel on graphics scene.
void deleteSelectedItems()
propagates deletion of views on the scene to the model
void deleteSelectedItems()
void onChangeScale(double)
void onSelectionMode(int)
void selectionModeChanged(int)
DesignerView(QGraphicsScene *scene, QWidget *parent=0)
void keyPressEvent(QKeyEvent *event)
void keyReleaseEvent(QKeyEvent *event)
int getSelectionMode() const