QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Types | Signals | Public Member Functions | List of all members
QgsLayoutNorthArrowHandler Class Reference

An object which handles north-arrow type behavior for layout items. More...

#include <qgslayoutnortharrowhandler.h>

Inheritance diagram for QgsLayoutNorthArrowHandler:
Inheritance graph
[legend]

Public Types

enum  NorthMode { GridNorth = 0 , TrueNorth }
 Method for syncing rotation to a map's North direction. More...
 

Signals

void arrowRotationChanged (double newRotation)
 Emitted on arrow rotation change. More...
 

Public Member Functions

 QgsLayoutNorthArrowHandler (QObject *parent)
 Constructor for QgsLayoutNorthArrowHandler, with the specified parent object. More...
 
double arrowRotation () const
 Returns the rotation to be used for the arrow, in degrees clockwise. More...
 
QgsLayoutItemMaplinkedMap () const
 Returns the linked rotation map, if set. More...
 
NorthMode northMode () const
 Returns the mode used to calculate the arrow rotation. More...
 
double northOffset () const
 Returns the offset added to the arrows's rotation from a map's North. More...
 
void setLinkedMap (QgsLayoutItemMap *map)
 Sets the linked map item. More...
 
void setNorthMode (NorthMode mode)
 Sets the mode used to calculate the arrow rotation. More...
 
void setNorthOffset (double offset)
 Sets the offset added to the arrows's rotation from a map's North. More...
 

Detailed Description

An object which handles north-arrow type behavior for layout items.

Since
QGIS 3.14

Definition at line 32 of file qgslayoutnortharrowhandler.h.

Member Enumeration Documentation

◆ NorthMode

Method for syncing rotation to a map's North direction.

Enumerator
GridNorth 

Align to grid north.

TrueNorth 

Align to true north.

Definition at line 38 of file qgslayoutnortharrowhandler.h.

Constructor & Destructor Documentation

◆ QgsLayoutNorthArrowHandler()

QgsLayoutNorthArrowHandler::QgsLayoutNorthArrowHandler ( QObject *  parent)

Constructor for QgsLayoutNorthArrowHandler, with the specified parent object.

Definition at line 24 of file qgslayoutnortharrowhandler.cpp.

Member Function Documentation

◆ arrowRotation()

double QgsLayoutNorthArrowHandler::arrowRotation ( ) const
inline

Returns the rotation to be used for the arrow, in degrees clockwise.

Definition at line 52 of file qgslayoutnortharrowhandler.h.

◆ arrowRotationChanged

void QgsLayoutNorthArrowHandler::arrowRotationChanged ( double  newRotation)
signal

Emitted on arrow rotation change.

◆ linkedMap()

QgsLayoutItemMap * QgsLayoutNorthArrowHandler::linkedMap ( ) const

Returns the linked rotation map, if set.

An nullptr means arrow calculation is disabled.

See also
setLinkedMap()

Definition at line 107 of file qgslayoutnortharrowhandler.cpp.

◆ northMode()

NorthMode QgsLayoutNorthArrowHandler::northMode ( ) const
inline

Returns the mode used to calculate the arrow rotation.

See also
setNorthMode()
northOffset()

Definition at line 74 of file qgslayoutnortharrowhandler.h.

◆ northOffset()

double QgsLayoutNorthArrowHandler::northOffset ( ) const
inline

Returns the offset added to the arrows's rotation from a map's North.

See also
setNorthOffset()
northMode()

Definition at line 88 of file qgslayoutnortharrowhandler.h.

◆ setLinkedMap()

void QgsLayoutNorthArrowHandler::setLinkedMap ( QgsLayoutItemMap map)

Sets the linked map item.

See also
linkedMap()

Definition at line 81 of file qgslayoutnortharrowhandler.cpp.

◆ setNorthMode()

void QgsLayoutNorthArrowHandler::setNorthMode ( QgsLayoutNorthArrowHandler::NorthMode  mode)

Sets the mode used to calculate the arrow rotation.

See also
northMode()
setNorthOffset()

Definition at line 112 of file qgslayoutnortharrowhandler.cpp.

◆ setNorthOffset()

void QgsLayoutNorthArrowHandler::setNorthOffset ( double  offset)

Sets the offset added to the arrows's rotation from a map's North.

See also
northOffset()
setNorthMode()

Definition at line 118 of file qgslayoutnortharrowhandler.cpp.


The documentation for this class was generated from the following files: