QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsmodelviewmousehandles.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmodelviewmousehandles.h
3 -----------------------
4 begin : March 2020
5 copyright : (C) 2020 by Nyall Dawson
6 email : nyall.dawson@gmail.com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSMODELVIEWMOUSEHANDLES_H
18#define QGSMODELVIEWMOUSEHANDLES_H
19
20#define SIP_NO_FILE
21
23#include <QPointer>
24#include <memory>
25
26#include "qgis_gui.h"
27
28class QgsModelGraphicsView;
29class QgsModelGraphicsScene;
30class QInputEvent;
31
32class QgsLayoutItem;
33
35
46class GUI_EXPORT QgsModelViewMouseHandles: public QgsGraphicsViewMouseHandles
47{
48 Q_OBJECT
49 public:
50
51 QgsModelViewMouseHandles( QgsModelGraphicsView *view );
52
53 void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr ) override;
54
55 protected:
56
57 void setViewportCursor( Qt::CursorShape cursor ) override;
58 QList<QGraphicsItem *> sceneItemsAtPoint( QPointF scenePoint ) override;
59 QList<QGraphicsItem *> selectedSceneItems( bool includeLockedItems = true ) const override;
60 QRectF itemRect( QGraphicsItem *item ) const override;
61 QRectF storedItemRect( QGraphicsItem *item ) const override;
62 void moveItem( QGraphicsItem *item, double deltaX, double deltaY ) override;
63 void previewItemMove( QGraphicsItem *item, double deltaX, double deltaY ) override;
64 void setItemRect( QGraphicsItem *item, QRectF rect ) override;
65 QRectF previewSetItemRect( QGraphicsItem *item, QRectF rect ) override;
66 void startMacroCommand( const QString &text ) override;
67 void endMacroCommand() override;
68 QPointF snapPoint( QPointF originalPoint, SnapGuideMode mode, bool snapHorizontal = true, bool snapVertical = true ) override;
69
70 public slots:
71
73 void selectionChanged();
74
75 private:
76 QgsModelGraphicsScene *modelScene() const;
77
78 QPointer< QgsModelGraphicsView > mView;
79};
80
82
83#endif // QGSMODELVIEWMOUSEHANDLES_H
Base class for graphical items within a QgsLayout.