QGIS API Documentation
3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
src
gui
layout
qgslayoutviewmouseevent.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutviewmouseevent.h
3
-------------------------
4
Date : July 2017
5
Copyright : (C) 2017 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 QGSLAYOUTVIEWMOUSEEVENT_H
17
#define QGSLAYOUTVIEWMOUSEEVENT_H
18
19
#include <QMouseEvent>
20
21
#include "qgis_gui.h"
22
23
class
QgsLayoutView
;
24
class
QGraphicsLineItem;
25
class
QgsLayoutItem
;
26
34
class
GUI_EXPORT
QgsLayoutViewMouseEvent
:
public
QMouseEvent
35
{
36
37
#ifdef SIP_RUN
38
SIP_CONVERT_TO_SUBCLASS_CODE
39
if
(
dynamic_cast<
QgsLayoutViewMouseEvent
*
>
( sipCpp ) )
40
sipType = sipType_QgsLayoutViewMouseEvent;
41
else
42
sipType = 0;
43
SIP_END
44
#endif
45
46
public
:
47
54
QgsLayoutViewMouseEvent
(
QgsLayoutView
*view, QMouseEvent *event,
bool
snap =
false
);
55
64
void
snapPoint( QGraphicsLineItem *horizontalSnapLine =
nullptr
, QGraphicsLineItem *verticalSnapLine =
nullptr
,
65
const
QList<QgsLayoutItem *> &ignoreItems = QList< QgsLayoutItem * >() );
66
70
QPointF layoutPoint()
const
;
71
77
QPointF
snappedPoint
()
const
{
return
mSnappedPoint; }
78
83
bool
isSnapped
()
const
{
return
mSnapped; }
84
85
private
:
86
88
QgsLayoutView
*mView =
nullptr
;
89
90
bool
mSnapped =
false
;
91
QPointF mLayoutPoint;
92
QPointF mSnappedPoint;
93
94
};
95
96
#endif
// QGSLAYOUTVIEWMOUSEEVENT_H
QgsLayoutItem
Base class for graphical items within a QgsLayout.
Definition
qgslayoutitem.h:110
QgsLayoutViewMouseEvent
A QgsLayoutViewMouseEvent is the result of a user interaction with the mouse on a QgsLayoutView.
Definition
qgslayoutviewmouseevent.h:35
QgsLayoutViewMouseEvent::isSnapped
bool isSnapped() const
Returns true if point was snapped, e.g.
Definition
qgslayoutviewmouseevent.h:83
QgsLayoutViewMouseEvent::snappedPoint
QPointF snappedPoint() const
Returns the snapped event point location in layout coordinates.
Definition
qgslayoutviewmouseevent.h:77
QgsLayoutView
A graphical widget to display and interact with QgsLayouts.
Definition
qgslayoutview.h:50
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:191
SIP_END
#define SIP_END
Definition
qgis_sip.h:208
Generated on Mon Feb 26 2024 10:02:44 for QGIS API Documentation by
1.9.8