QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsmodelviewtoolselect.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmodelviewtoolselect.h
3 -------------------------
4 Date : March 2020
5 Copyright : (C) 2020 Nyall Dawson
6
7 Email : nyall dot dawson at gmail dot com
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSMODELVIEWTOOLSELECT_H
18#define QGSMODELVIEWTOOLSELECT_H
19
20#include "qgis_sip.h"
21#include "qgis_gui.h"
22#include "qgsmodelviewtool.h"
24#include <memory>
25
26class QgsModelViewMouseHandles;
27class QGraphicsItem;
28
29#define SIP_NO_FILE
30
37{
38 Q_OBJECT
39
40 public:
44 QgsModelViewToolSelect( QgsModelGraphicsView *view SIP_TRANSFERTHIS );
45 ~QgsModelViewToolSelect() override;
46
47 void modelPressEvent( QgsModelViewMouseEvent *event ) override;
48 void modelMoveEvent( QgsModelViewMouseEvent *event ) override;
49 void modelDoubleClickEvent( QgsModelViewMouseEvent *event ) override;
50 void modelReleaseEvent( QgsModelViewMouseEvent *event ) override;
51 void wheelEvent( QWheelEvent *event ) override;
52 void keyPressEvent( QKeyEvent *event ) override;
53 void deactivate() override;
54 bool allowItemInteraction() override;
55
59 QgsModelViewMouseHandles *mouseHandles();
60
62 void setScene( QgsModelGraphicsScene *scene );
63
67 void resetCache();
68
69 private:
70 bool mIsSelecting = false;
71
73 std::unique_ptr<QgsModelViewRubberBand> mRubberBand;
74
76 QPoint mMousePressStartPos;
77
79 QPointF mRubberBandStartPos;
80
81 QPointer<QgsModelViewMouseHandles> mMouseHandles; //owned by scene
82 QList<QGraphicsItem *> mHoverEnteredItems;
83};
84
85#endif // QGSMODELVIEWTOOLSELECT_H
A QgsModelViewMouseEvent is the result of a user interaction with the mouse on a QgsModelGraphicsView...
Model designer view tool for selecting items in the model.
Abstract base class for all model designer view tools.
virtual void modelDoubleClickEvent(QgsModelViewMouseEvent *event)
Mouse double-click event for overriding.
virtual void wheelEvent(QWheelEvent *event)
Mouse wheel event for overriding.
virtual void modelMoveEvent(QgsModelViewMouseEvent *event)
Mouse move event for overriding.
virtual bool allowItemInteraction()
Returns true if the tool allows interaction with component graphic items.
virtual void deactivate()
Called when tool is deactivated.
virtual void modelPressEvent(QgsModelViewMouseEvent *event)
Mouse press event for overriding.
virtual void keyPressEvent(QKeyEvent *event)
Key press event for overriding.
virtual void modelReleaseEvent(QgsModelViewMouseEvent *event)
Mouse release event for overriding.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53