QGIS API Documentation 3.99.0-Master (c22de0620c0)
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
21#include <memory>
22
23#include "qgis_gui.h"
25
26#include <QPointer>
27
28#define SIP_NO_FILE
29
30class QgsModelGraphicsView;
31class QgsModelGraphicsScene;
32class QInputEvent;
33
34class QgsLayoutItem;
35
37
48class GUI_EXPORT QgsModelViewMouseHandles : public QgsGraphicsViewMouseHandles
49{
50 Q_OBJECT
51 public:
52 QgsModelViewMouseHandles( QgsModelGraphicsView *view );
53
54 void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr ) override;
55
56 protected:
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.