QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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:
39 {
42 };
43
48
52 double arrowRotation() const { return mArrowRotation; }
53
59 void setLinkedMap( QgsLayoutItemMap *map );
60
67 QgsLayoutItemMap *linkedMap() const;
68
74 NorthMode northMode() const { return mNorthMode; }
75
81 void setNorthMode( NorthMode mode );
82
88 double northOffset() const { return mNorthOffset; }
89
95 void setNorthOffset( double offset );
96
97 signals:
99 void arrowRotationChanged( double newRotation );
100
101 private:
103 double mArrowRotation = 0;
104
105 QString mRotationMapUuid;
107 QPointer< QgsLayoutItemMap > mRotationMap;
108
110 NorthMode mNorthMode = GridNorth;
112 double mNorthOffset = 0.0;
113
114 void disconnectMap( QgsLayoutItemMap *map );
115
116 private slots:
117
118 void updateMapRotation();
119};
120
121#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:52