16 #ifndef QGSMODELGRAPHICVIEW_H
17 #define QGSMODELGRAPHICVIEW_H
23 #include <QGraphicsView>
24 #include <QGraphicsRectItem>
30 class QgsModelComponentGraphicItem;
31 class QgsModelGraphicsScene;
32 class QgsModelViewSnapMarker;
42 class GUI_EXPORT QgsModelGraphicsView :
public QGraphicsView
51 QgsModelGraphicsView( QWidget *parent =
nullptr );
52 ~QgsModelGraphicsView()
override;
54 void dragEnterEvent( QDragEnterEvent *event )
override;
55 void dropEvent( QDropEvent *event )
override;
56 void dragMoveEvent( QDragMoveEvent *event )
override;
57 void wheelEvent( QWheelEvent *event )
override;
58 void mousePressEvent( QMouseEvent *event )
override;
59 void mouseReleaseEvent( QMouseEvent *event )
override;
60 void mouseMoveEvent( QMouseEvent *event )
override;
61 void mouseDoubleClickEvent( QMouseEvent *event )
override;
62 void keyPressEvent( QKeyEvent *event )
override;
63 void keyReleaseEvent( QKeyEvent *event )
override;
68 void setModelScene( QgsModelGraphicsScene *scene );
74 QgsModelGraphicsScene *modelScene()
const;
106 void startMacroCommand( const QString &text );
111 void endMacroCommand();
115 enum ClipboardOperation
126 void copySelectedItems( ClipboardOperation operation );
133 void copyItems(
const QList< QgsModelComponentGraphicItem * > &items, ClipboardOperation operation );
149 void pasteItems( PasteMode mode );
163 void algorithmDropped(
const QString &algorithmId,
const QPointF &pos );
168 void inputDropped(
const QString &inputId,
const QPointF &pos );
180 void itemFocused( QgsModelComponentGraphicItem *item );
186 void willBeDeleted();
191 void macroCommandStarted(
const QString &text );
196 void macroCommandEnded();
201 void beginCommand(
const QString &text );
211 void deleteSelectedItems();
216 void wheelZoom( QWheelEvent *event );
222 void scaleSafe(
double scale );
228 QPointF deltaForKeyEvent( QKeyEvent *event );
230 QPointer< QgsModelViewTool > mTool;
236 QPoint mMouseCurrentXY;
239 QgsModelViewSnapMarker *mSnapMarker =
nullptr;
247 class GUI_EXPORT QgsModelViewSnapMarker :
public QGraphicsRectItem
251 QgsModelViewSnapMarker();
253 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget =
nullptr )
override;
Manages snapping grids and preset snap lines in a layout, and handles snapping points to the nearest ...