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();
115 void beginCommand( const QString &text );
124 enum ClipboardOperation
135 void copySelectedItems( ClipboardOperation operation );
142 void copyItems(
const QList<QgsModelComponentGraphicItem *> &items, ClipboardOperation operation );
158 void pasteItems( PasteMode mode );
172 void algorithmDropped(
const QString &algorithmId,
const QPointF &pos );
177 void inputDropped(
const QString &inputId,
const QPointF &pos );
189 void itemFocused( QgsModelComponentGraphicItem *item );
195 void willBeDeleted();
200 void macroCommandStarted(
const QString &text );
205 void macroCommandEnded();
210 void commandBegun(
const QString &text );
220 void deleteSelectedItems();
224 void wheelZoom( QWheelEvent *event );
230 void scaleSafe(
double scale );
236 QPointF deltaForKeyEvent( QKeyEvent *event );
238 QPointer<QgsModelViewTool> mTool;
244 QPoint mMouseCurrentXY;
247 QgsModelViewSnapMarker *mSnapMarker =
nullptr;
255class GUI_EXPORT QgsModelViewSnapMarker :
public QGraphicsRectItem
258 QgsModelViewSnapMarker();
260 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 ...