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 | Private Attributes | 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>

Collaboration diagram for QgsMapLayerProxyModel:
Collaboration graph
[legend]

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 ()
 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

Private Attributes

Filters mFilters
QgsMapLayerModelmModel

Detailed Description

The QgsMapLayerProxModel 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.

References mModel.

Member Function Documentation

bool QgsMapLayerProxyModel::filterAcceptsRow ( int  source_row,
const QModelIndex &  source_parent 
) const
const Filters& QgsMapLayerProxyModel::filters ( ) const
inline

Definition at line 63 of file qgsmaplayerproxymodel.h.

Referenced by QgsMapLayerComboBox::filters(), and setFilters().

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

Definition at line 79 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 29 of file qgsmaplayerproxymodel.cpp.

References filters(), and mFilters.

Referenced by QgsMapLayerComboBox::setFilters().

QgsMapLayerModel* QgsMapLayerProxyModel::sourceLayerModel ( )
inline

layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel

Definition at line 55 of file qgsmaplayerproxymodel.h.

Referenced by QgsMapLayerComboBox::setLayer().

Member Data Documentation

Filters QgsMapLayerProxyModel::mFilters
private

Definition at line 66 of file qgsmaplayerproxymodel.h.

Referenced by filterAcceptsRow(), and setFilters().

QgsMapLayerModel* QgsMapLayerProxyModel::mModel
private

Definition at line 67 of file qgsmaplayerproxymodel.h.

Referenced by QgsMapLayerProxyModel().


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