Skip to content

Class QfDigitizingLayerModel

ClassList > QfDigitizingLayerModel

A digitizing layers (map layers and markup collections) model.

  • #include <qfdigitizinglayermodel.h>

Inherits the following classes: QSortFilterProxyModel

Public Types

Type Name
enum LayerType
enum Role

Public Properties

Type Name
property bool enabled
property QfMarkupManager * markups
The markup manager from which markup collections will be taken from.
property QgsProject * project
The project from which map layers will be taken from.

Public Signals

Type Name
signal void enabledChanged
signal void markupManagerChanged
signal void projectChanged

Public Functions

Type Name
QfDigitizingLayerModel (QObject * parent=nullptr)
The constructor.
bool enabled () const
Q_INVOKABLE int findCollection (QfMarkupCollection * collection) const
Q_INVOKABLE int findCollectionName (const QString & name) const
Q_INVOKABLE int findLayer (QgsMapLayer * layer) const
Q_INVOKABLE int findLayerName (const QString & name) const
Q_INVOKABLE QVariantMap get (int row) const
bool lessThan (const QModelIndex & left, const QModelIndex & right) override const
QfMarkupManager * markupManager () const
QgsProject * project () const
The project from which map layers will be taken from.
void setEnabled (bool enabled)
void setMarkupManager (QfMarkupManager * markupManager)
void setProject (QgsProject * project)
The project from which map layers will be taken from.

Public Types Documentation

enum LayerType

enum QfDigitizingLayerModel::LayerType {
    MapLayer = 1,
    MarkupCollection
};

enum Role

enum QfDigitizingLayerModel::Role {
    IdRole = Qt::UserRole + 1,
    NameRole,
    LayerTypeRole,
    LayerRole,
    GeometryTypeRole
};

Public Properties Documentation

property enabled [1/2]

bool QfDigitizingLayerModel::enabled;

The enabled state of the model.

Note:

When disabled, any changes to the project's map layers registry and markup manager will be ignored


property markups

The markup manager from which markup collections will be taken from.

QfMarkupManager * QfDigitizingLayerModel::markups;


property project [1/2]

The project from which map layers will be taken from.

QgsProject * QfDigitizingLayerModel::project;


Public Signals Documentation

signal enabledChanged

void QfDigitizingLayerModel::enabledChanged;

signal markupManagerChanged

void QfDigitizingLayerModel::markupManagerChanged;

signal projectChanged

void QfDigitizingLayerModel::projectChanged;

Public Functions Documentation

function QfDigitizingLayerModel

The constructor.

explicit QfDigitizingLayerModel::QfDigitizingLayerModel (
    QObject * parent=nullptr
) 


function enabled [2/2]

bool QfDigitizingLayerModel::enabled () const

The enabled state of the model.

Note:

When disabled, any changes to the project's map layers registry and markup manager will be ignored


function findCollection

Q_INVOKABLE int QfDigitizingLayerModel::findCollection (
    QfMarkupCollection * collection
) const

Returns the model row for given markup collection.

Note:

If the collection is not found, -1 will be returned


function findCollectionName

Q_INVOKABLE int QfDigitizingLayerModel::findCollectionName (
    const QString & name
) const

Returns the model row for given markup collection name.

Note:

If the collection name is not found, -1 will be returned


function findLayer

Q_INVOKABLE int QfDigitizingLayerModel::findLayer (
    QgsMapLayer * layer
) const

Returns the model row for given map layer.

Note:

If the map layer is not found, -1 will be returned


function findLayerName

Q_INVOKABLE int QfDigitizingLayerModel::findLayerName (
    const QString & name
) const

Returns the model row for given map layer name.

Note:

If the map layer name is not found, -1 will be returned


function get

Q_INVOKABLE QVariantMap QfDigitizingLayerModel::get (
    int row
) const

Returns a model data map for a given row.


function lessThan

bool QfDigitizingLayerModel::lessThan (
    const QModelIndex & left,
    const QModelIndex & right
) override const

function markupManager

QfMarkupManager * QfDigitizingLayerModel::markupManager () const

function project [2/2]

The project from which map layers will be taken from.

QgsProject * QfDigitizingLayerModel::project () const


function setEnabled

void QfDigitizingLayerModel::setEnabled (
    bool enabled
) 

The enabled state of the model.

Note:

When disabled, any changes to the project's map layers registry and markup manager will be ignored


function setMarkupManager

void QfDigitizingLayerModel::setMarkupManager (
    QfMarkupManager * markupManager
) 

function setProject

The project from which map layers will be taken from.

void QfDigitizingLayerModel::setProject (
    QgsProject * project
) 



The documentation for this class was generated from the following file src/core/qfdigitizinglayermodel.h