QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
QgsMapLayerProxyModel Class Reference

The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widgets. More...

#include <qgsmaplayerproxymodel.h>

Public Types

enum  Filter {
  RasterLayer = 1, NoGeometry = 2, PointLayer = 4, LineLayer = 8,
  PolygonLayer = 16, HasGeometry = PointLayer | LineLayer | PolygonLayer, VectorLayer = NoGeometry | HasGeometry, PluginLayer = 32,
  All = RasterLayer | PolygonLayer | PluginLayer
}

Public Member Functions

 QgsMapLayerProxyModel (QObject *parent=0)
 QgsMapLayerProxModel creates a proxy model with a QgsMapLayerModel as source model.
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override
const Filters & filters () const
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
QgsMapLayerProxyModelsetFilters (Filters filters)
 setFilters set flags that affect how layers are filtered
QgsMapLayerModelsourceLayerModel () const
 layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel

Detailed Description

The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widgets.

Note
added in 2.3

Definition at line 27 of file qgsmaplayerproxymodel.h.

Member Enumeration Documentation

Enumerator:
RasterLayer 
NoGeometry 
PointLayer 
LineLayer 
PolygonLayer 
HasGeometry 
VectorLayer 
PluginLayer 
All 

Definition at line 32 of file qgsmaplayerproxymodel.h.

Constructor & Destructor Documentation

QgsMapLayerProxyModel::QgsMapLayerProxyModel ( QObject *  parent = 0)
explicit

QgsMapLayerProxModel creates a proxy model with a QgsMapLayerModel as source model.

It can be used to filter the layers list in a widget.

Definition at line 21 of file qgsmaplayerproxymodel.cpp.

Member Function Documentation

bool QgsMapLayerProxyModel::filterAcceptsRow ( int  source_row,
const QModelIndex &  source_parent 
) const
override

Definition at line 40 of file qgsmaplayerproxymodel.cpp.

const Filters& QgsMapLayerProxyModel::filters ( ) const
inline

Definition at line 63 of file qgsmaplayerproxymodel.h.

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

Definition at line 83 of file qgsmaplayerproxymodel.cpp.

QgsMapLayerProxyModel * QgsMapLayerProxyModel::setFilters ( Filters  filters)

setFilters set flags that affect how layers are filtered

Parameters
filtersare Filter flags
Note
added in 2.3

Definition at line 33 of file qgsmaplayerproxymodel.cpp.

QgsMapLayerModel* QgsMapLayerProxyModel::sourceLayerModel ( ) const
inline

layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel

Definition at line 55 of file qgsmaplayerproxymodel.h.


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