QGIS API Documentation 3.41.0-Master (cea29feecf2)
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
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 QgsModelViewMouseHandles( QgsModelGraphicsView *view );
51
52 void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr ) override;
53
54 protected:
55 void setViewportCursor( Qt::CursorShape cursor ) override;
56 QList<QGraphicsItem *> sceneItemsAtPoint( QPointF scenePoint ) override;
57 QList<QGraphicsItem *> selectedSceneItems( bool includeLockedItems = true ) const override;
58 QRectF itemRect( QGraphicsItem *item ) const override;
59 QRectF storedItemRect( QGraphicsItem *item ) const override;
60 void moveItem( QGraphicsItem *item, double deltaX, double deltaY ) override;
61 void previewItemMove( QGraphicsItem *item, double deltaX, double deltaY ) override;
62 void setItemRect( QGraphicsItem *item, QRectF rect ) override;
63 QRectF previewSetItemRect( QGraphicsItem *item, QRectF rect ) override;
64 void startMacroCommand( const QString &text ) override;
65 void endMacroCommand() override;
66 QPointF snapPoint( QPointF originalPoint, SnapGuideMode mode, bool snapHorizontal = true, bool snapVertical = true ) override;
67
68 public slots:
69
71 void selectionChanged();
72
73 private:
74 QgsModelGraphicsScene *modelScene() const;
75
76 QPointer<QgsModelGraphicsView> mView;
77};
78
80
81#endif // QGSMODELVIEWMOUSEHANDLES_H
Base class for graphical items within a QgsLayout.