16#ifndef QGSMODELGRAPHICVIEW_H
17#define QGSMODELGRAPHICVIEW_H
23#include <QGraphicsView>
24#include <QGraphicsRectItem>
30class QgsModelComponentGraphicItem;
31class QgsModelGraphicsScene;
32class QgsModelViewSnapMarker;
42class GUI_EXPORT QgsModelGraphicsView :
public QGraphicsView
50 QgsModelGraphicsView( QWidget *parent =
nullptr );
51 ~QgsModelGraphicsView()
override;
53 void dragEnterEvent( QDragEnterEvent *event )
override;
54 void dropEvent( QDropEvent *event )
override;
55 void dragMoveEvent( QDragMoveEvent *event )
override;
56 void wheelEvent( QWheelEvent *event )
override;
57 void mousePressEvent( QMouseEvent *event )
override;
58 void mouseReleaseEvent( QMouseEvent *event )
override;
59 void mouseMoveEvent( QMouseEvent *event )
override;
60 void mouseDoubleClickEvent( QMouseEvent *event )
override;
61 void keyPressEvent( QKeyEvent *event )
override;
62 void keyReleaseEvent( QKeyEvent *event )
override;
67 void setModelScene( QgsModelGraphicsScene *scene );
73 QgsModelGraphicsScene *modelScene()
const;
105 void startMacroCommand( const QString &text );
110 void endMacroCommand();
114 enum ClipboardOperation
125 void copySelectedItems( ClipboardOperation operation );
132 void copyItems(
const QList<QgsModelComponentGraphicItem *> &items, ClipboardOperation operation );
148 void pasteItems( PasteMode mode );
162 void algorithmDropped(
const QString &algorithmId,
const QPointF &pos );
167 void inputDropped(
const QString &inputId,
const QPointF &pos );
179 void itemFocused( QgsModelComponentGraphicItem *item );
185 void willBeDeleted();
190 void macroCommandStarted(
const QString &text );
195 void macroCommandEnded();
200 void beginCommand(
const QString &text );
210 void deleteSelectedItems();
214 void wheelZoom( QWheelEvent *event );
220 void scaleSafe(
double scale );
226 QPointF deltaForKeyEvent( QKeyEvent *event );
228 QPointer<QgsModelViewTool> mTool;
234 QPoint mMouseCurrentXY;
237 QgsModelViewSnapMarker *mSnapMarker =
nullptr;
245class GUI_EXPORT QgsModelViewSnapMarker :
public QGraphicsRectItem
248 QgsModelViewSnapMarker();
250 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 ...