QGIS API Documentation  2.5.0-Master
 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 QgsMapLayerProxModel 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.
QgsMapLayerModelsourceLayerModel () const
 layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
QgsMapLayerProxyModelsetFilters (Filters filters)
 setFilters set flags that affect how layers are filtered
const Filters & filters () const
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const
bool lessThan (const QModelIndex &left, const QModelIndex &right) const

Detailed Description

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

Note
added in 2.3

Member Enumeration Documentation

Enumerator:
RasterLayer 
NoGeometry 
PointLayer 
LineLayer 
PolygonLayer 
HasGeometry 
VectorLayer 
PluginLayer 
All 

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.

Member Function Documentation

bool QgsMapLayerProxyModel::filterAcceptsRow ( int  source_row,
const QModelIndex &  source_parent 
) const
const Filters& QgsMapLayerProxyModel::filters ( ) const
inline
bool QgsMapLayerProxyModel::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
QgsMapLayerProxyModel * QgsMapLayerProxyModel::setFilters ( Filters  filters)

setFilters set flags that affect how layers are filtered

Parameters
filtersare Filter flags
Note
added in 2.3
QgsMapLayerModel* QgsMapLayerProxyModel::sourceLayerModel ( ) const
inline

layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel


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