QGIS API Documentation
4.3.0-Master (8c22baaae17)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
processing
models
qgsmodelviewmouseevent.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmodelviewmouseevent.h
3
-------------------------
4
Date : March 2020
5
Copyright : (C) 2020 Nyall Dawson
6
Email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSMODELVIEWMOUSEEVENT_H
17
#define QGSMODELVIEWMOUSEEVENT_H
18
19
#include "qgis_gui.h"
20
21
#include <QMouseEvent>
22
23
#define SIP_NO_FILE
24
25
class
QgsModelGraphicsView;
26
36
class
GUI_EXPORT
QgsModelViewMouseEvent
:
public
QMouseEvent
37
{
38
public
:
45
QgsModelViewMouseEvent
( QgsModelGraphicsView *view, QMouseEvent *event,
bool
snaps );
46
50
void
snapPoint
();
51
55
QPointF
modelPoint
()
const
;
56
62
QPointF
snappedPoint
()
const
{
return
mSnappedPoint; }
63
68
bool
isSnapped
()
const
{
return
mSnapped; }
69
70
71
private
:
73
QgsModelGraphicsView *mView =
nullptr
;
74
75
QPointF mModelPoint;
76
bool
mSnapped =
false
;
77
QPointF mSnappedPoint;
78
};
79
80
#endif
// QGSMODELVIEWMOUSEEVENT_H
QgsModelViewMouseEvent::QgsModelViewMouseEvent
QgsModelViewMouseEvent(QgsModelGraphicsView *view, QMouseEvent *event, bool snaps)
Constructor for QgsModelViewMouseEvent.
Definition
qgsmodelviewmouseevent.cpp:21
QgsModelViewMouseEvent::isSnapped
bool isSnapped() const
Returns true if point was snapped, e.g.
Definition
qgsmodelviewmouseevent.h:68
QgsModelViewMouseEvent::snapPoint
void snapPoint()
Manually triggers a snap for the mouse event position using the model's snapper.
Definition
qgsmodelviewmouseevent.cpp:37
QgsModelViewMouseEvent::modelPoint
QPointF modelPoint() const
Returns the event point location in model coordinates.
Definition
qgsmodelviewmouseevent.cpp:45
QgsModelViewMouseEvent::snappedPoint
QPointF snappedPoint() const
Returns the snapped event point location in model coordinates.
Definition
qgsmodelviewmouseevent.h:62
Generated on
for QGIS API Documentation by
1.17.0