QGIS API Documentation 3.99.0-Master (26c88405ac0)
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
22#include <memory>
23
24#include "qgis_gui.h"
26
27#include <QPointer>
28
29class QgsModelGraphicsView;
30class QgsModelGraphicsScene;
31class QInputEvent;
32
33class QgsLayoutItem;
34
36
47class GUI_EXPORT QgsModelViewMouseHandles : public QgsGraphicsViewMouseHandles
48{
49 Q_OBJECT
50 public:
51 QgsModelViewMouseHandles( QgsModelGraphicsView *view );
52
53 void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr ) override;
54
55 protected:
56 void setViewportCursor( Qt::CursorShape cursor ) override;
57 QList<QGraphicsItem *> sceneItemsAtPoint( QPointF scenePoint ) override;
58 QList<QGraphicsItem *> selectedSceneItems( bool includeLockedItems = true ) const override;
59 QRectF itemRect( QGraphicsItem *item ) const override;
60 QRectF storedItemRect( QGraphicsItem *item ) const override;
61 void moveItem( QGraphicsItem *item, double deltaX, double deltaY ) override;
62 void previewItemMove( QGraphicsItem *item, double deltaX, double deltaY ) override;
63 void setItemRect( QGraphicsItem *item, QRectF rect ) override;
64 QRectF previewSetItemRect( QGraphicsItem *item, QRectF rect ) override;
65 void startMacroCommand( const QString &text ) override;
66 void endMacroCommand() override;
67 QPointF snapPoint( QPointF originalPoint, SnapGuideMode mode, bool snapHorizontal = true, bool snapVertical = true ) override;
68
69 public slots:
70
72 void selectionChanged();
73
74 private:
75 QgsModelGraphicsScene *modelScene() const;
76
77 QPointer<QgsModelGraphicsView> mView;
78};
79
81
82#endif // QGSMODELVIEWMOUSEHANDLES_H
Base class for graphical items within a QgsLayout.