QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QgsCoordinateReferenceSystemModel Class Reference

A tree model for display of known coordinate reference systems. More...

#include <qgscoordinatereferencesystemmodel.h>

Inheritance diagram for QgsCoordinateReferenceSystemModel:
Inheritance graph
[legend]

Public Types

enum class  CustomRole : int {
  NodeType = Qt::UserRole , Name = Qt::UserRole + 1 , AuthId = Qt::UserRole + 2 , Deprecated = Qt::UserRole + 3 ,
  Type = Qt::UserRole + 4 , GroupId = Qt::UserRole + 5 , Wkt = Qt::UserRole + 6 , Proj = Qt::UserRole + 7 ,
  Group = Qt::UserRole + 8 , Projection = Qt::UserRole + 9
}
 Custom model roles. More...
 

Public Member Functions

 QgsCoordinateReferenceSystemModel (QObject *parent=nullptr)
 Constructor for QgsCoordinateReferenceSystemModel, with the specified parent object.
 
QModelIndex addCustomCrs (const QgsCoordinateReferenceSystem &crs)
 Adds a custom crs to the model.
 
QModelIndex authIdToIndex (const QString &authId) const
 Retrieves the model index corresponding to a CRS with the specified authId.
 
int columnCount (const QModelIndex &=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 

Detailed Description

A tree model for display of known coordinate reference systems.

Since
QGIS 3.34

Definition at line 246 of file qgscoordinatereferencesystemmodel.h.

Member Enumeration Documentation

◆ CustomRole

Custom model roles.

Note
Prior to QGIS 3.36 this was available as QgsCoordinateReferenceSystemModel::Roles
Since
QGIS 3.36
Enumerator
NodeType 

Corresponds to the node's type.

Name 

The coordinate reference system name.

AuthId 

The coordinate reference system authority name and id.

Deprecated 

true if the CRS is deprecated

Type 

The coordinate reference system type.

GroupId 

The node ID (for group nodes)

Wkt 

The coordinate reference system's WKT representation. This is only used for non-standard CRS (i.e. those not present in the database).

Proj 

The coordinate reference system's PROJ representation. This is only used for non-standard CRS (i.e. those not present in the database).

Group 

Group name.

Since
QGIS 3.42
Projection 

Projection name.

Since
QGIS 3.42

Definition at line 259 of file qgscoordinatereferencesystemmodel.h.

Constructor & Destructor Documentation

◆ QgsCoordinateReferenceSystemModel()

QgsCoordinateReferenceSystemModel::QgsCoordinateReferenceSystemModel ( QObject *  parent = nullptr)

Constructor for QgsCoordinateReferenceSystemModel, with the specified parent object.

Definition at line 25 of file qgscoordinatereferencesystemmodel.cpp.

Member Function Documentation

◆ addCustomCrs()

QModelIndex QgsCoordinateReferenceSystemModel::addCustomCrs ( const QgsCoordinateReferenceSystem crs)

Adds a custom crs to the model.

This method can be used to add CRS which aren't present in either the standard PROJ SRS database or the user's custom CRS database to the model.

Definition at line 470 of file qgscoordinatereferencesystemmodel.cpp.

◆ authIdToIndex()

QModelIndex QgsCoordinateReferenceSystemModel::authIdToIndex ( const QString &  authId) const

Retrieves the model index corresponding to a CRS with the specified authId.

Returns an invalid index if the CRS was not found.

Definition at line 242 of file qgscoordinatereferencesystemmodel.cpp.

◆ columnCount()

int QgsCoordinateReferenceSystemModel::columnCount ( const QModelIndex &  = QModelIndex()) const
override

Definition at line 209 of file qgscoordinatereferencesystemmodel.cpp.

◆ data()

QVariant QgsCoordinateReferenceSystemModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 59 of file qgscoordinatereferencesystemmodel.cpp.

◆ flags()

Qt::ItemFlags QgsCoordinateReferenceSystemModel::flags ( const QModelIndex &  index) const
override

Definition at line 38 of file qgscoordinatereferencesystemmodel.cpp.

◆ headerData()

QVariant QgsCoordinateReferenceSystemModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Definition at line 175 of file qgscoordinatereferencesystemmodel.cpp.

◆ index()

QModelIndex QgsCoordinateReferenceSystemModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 214 of file qgscoordinatereferencesystemmodel.cpp.

◆ parent()

QModelIndex QgsCoordinateReferenceSystemModel::parent ( const QModelIndex &  index) const
override

Definition at line 226 of file qgscoordinatereferencesystemmodel.cpp.

◆ rowCount()

int QgsCoordinateReferenceSystemModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 200 of file qgscoordinatereferencesystemmodel.cpp.


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