Skip to content

Class QfMapLayerModel

ClassList > QfMapLayerModel

A project map layers model within filtering capabilities.

  • #include <qfmaplayermodel.h>

Inherits the following classes: QSortFilterProxyModel

Public Types

Type Name
enum Role

Public Properties

Type Name
property bool enabled
property Qgis::LayerFilters filters
The map layer filters.
property QgsProject * project
The project from which map layers will be taken from.
property bool requiresTrackingAvailability
The tracking availability requirement filter.
property QfTrackingModel * trackingModel
The tracking model against which map layers' tracking availability will be checked against.

Public Signals

Type Name
signal void enabledChanged
signal void filtersChanged
signal void projectChanged
signal void requiresTrackingAvailabilityChanged
signal void trackingModelChanged

Public Functions

Type Name
QfMapLayerModel (QObject * parent=nullptr)
The constructor.
bool enabled () const
bool filterAcceptsRow (int sourceRow, const QModelIndex & sourceParent) override const
Qgis::LayerFilters filters () const
The map layer filters.
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
QgsProject * project () const
The project from which map layers will be taken from.
bool requiresTrackingAvailability () const
The tracking availability requirement filter.
void setEnabled (bool enabled)
void setFilters (Qgis::LayerFilters filters)
The map layer filters.
void setProject (QgsProject * project)
The project from which map layers will be taken from.
void setRequiresTrackingAvailability (bool requiresTrackingAvailability)
The tracking availability requirement filter.
void setTrackingModel (QfTrackingModel * trackingModel)
The tracking model against which map layers' tracking availability will be checked against.
QfTrackingModel * trackingModel () const
The tracking model against which map layers' tracking availability will be checked against.

Public Types Documentation

enum Role

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

Public Properties Documentation

property enabled [1/2]

bool QfMapLayerModel::enabled;

The enabled state of the model.

Note:

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


property filters [1/2]

The map layer filters.

Qgis::LayerFilters QfMapLayerModel::filters;


property project [1/2]

The project from which map layers will be taken from.

QgsProject * QfMapLayerModel::project;


property requiresTrackingAvailability [1/2]

The tracking availability requirement filter.

bool QfMapLayerModel::requiresTrackingAvailability;


property trackingModel [1/2]

The tracking model against which map layers' tracking availability will be checked against.

QfTrackingModel * QfMapLayerModel::trackingModel;


Public Signals Documentation

signal enabledChanged

void QfMapLayerModel::enabledChanged;

signal filtersChanged

void QfMapLayerModel::filtersChanged;

signal projectChanged

void QfMapLayerModel::projectChanged;

signal requiresTrackingAvailabilityChanged

void QfMapLayerModel::requiresTrackingAvailabilityChanged;

signal trackingModelChanged

void QfMapLayerModel::trackingModelChanged;

Public Functions Documentation

function QfMapLayerModel

The constructor.

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


function enabled [2/2]

bool QfMapLayerModel::enabled () const

The enabled state of the model.

Note:

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


function filterAcceptsRow

bool QfMapLayerModel::filterAcceptsRow (
    int sourceRow,
    const QModelIndex & sourceParent
) override const

function filters [2/2]

The map layer filters.

inline Qgis::LayerFilters QfMapLayerModel::filters () const


function findLayer

Q_INVOKABLE int QfMapLayerModel::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 QfMapLayerModel::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 QfMapLayerModel::get (
    int row
) const

Returns a model data map for a given row.


function lessThan

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

function project [2/2]

The project from which map layers will be taken from.

QgsProject * QfMapLayerModel::project () const


function requiresTrackingAvailability [2/2]

The tracking availability requirement filter.

inline bool QfMapLayerModel::requiresTrackingAvailability () const


function setEnabled

void QfMapLayerModel::setEnabled (
    bool enabled
) 

The enabled state of the model.

Note:

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


function setFilters

The map layer filters.

void QfMapLayerModel::setFilters (
    Qgis::LayerFilters filters
) 


function setProject

The project from which map layers will be taken from.

void QfMapLayerModel::setProject (
    QgsProject * project
) 


function setRequiresTrackingAvailability

The tracking availability requirement filter.

void QfMapLayerModel::setRequiresTrackingAvailability (
    bool requiresTrackingAvailability
) 


function setTrackingModel

The tracking model against which map layers' tracking availability will be checked against.

void QfMapLayerModel::setTrackingModel (
    QfTrackingModel * trackingModel
) 


function trackingModel [2/2]

The tracking model against which map layers' tracking availability will be checked against.

QfTrackingModel * QfMapLayerModel::trackingModel () const



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