QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgslayoutnortharrowhandler.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayoutnortharrowhandler.h
3 -------------------
4begin : April 2020
5copyright : (C) 2020 by Nyall Dawson
6email : nyall dot dawson at gmail dot com
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 QGSLAYOUTNORTHARROWHANDLER_H
18#define QGSLAYOUTNORTHARROWHANDLER_H
19
20#include "qgis_core.h"
21#include "qgis_sip.h"
22
23#include <QObject>
24#include <QPointer>
25
27
33class CORE_EXPORT QgsLayoutNorthArrowHandler: public QObject
34{
35 Q_OBJECT
36 public:
37
40 {
43 };
44
49
53 double arrowRotation() const { return mArrowRotation; }
54
60 void setLinkedMap( QgsLayoutItemMap *map );
61
68 QgsLayoutItemMap *linkedMap() const;
69
75 NorthMode northMode() const { return mNorthMode; }
76
82 void setNorthMode( NorthMode mode );
83
89 double northOffset() const { return mNorthOffset; }
90
96 void setNorthOffset( double offset );
97
98 signals:
100 void arrowRotationChanged( double newRotation );
101
102 private:
103
105 double mArrowRotation = 0;
106
107 QString mRotationMapUuid;
109 QPointer< QgsLayoutItemMap > mRotationMap;
110
112 NorthMode mNorthMode = GridNorth;
114 double mNorthOffset = 0.0;
115
116 void disconnectMap( QgsLayoutItemMap *map );
117
118 private slots:
119
120 void updateMapRotation();
121
122
123};
124
125#endif // QGSLAYOUTNORTHARROWHANDLER_H
Layout graphical items for displaying a map.
An object which handles north-arrow type behavior for layout items.
NorthMode northMode() const
Returns the mode used to calculate the arrow rotation.
double arrowRotation() const
Returns the rotation to be used for the arrow, in degrees clockwise.
void arrowRotationChanged(double newRotation)
Emitted on arrow rotation change.
NorthMode
Method for syncing rotation to a map's North direction.
QgsLayoutNorthArrowHandler(QObject *parent)
Constructor for QgsLayoutNorthArrowHandler, with the specified parent object.
double northOffset() const
Returns the offset added to the arrows's rotation from a map's North.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53