QGIS API Documentation  2.2.0-Valmiera
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Slots | Public Member Functions | Private Attributes | List of all members
QgsFeatureListModel Class Reference

#include <qgsfeaturelistmodel.h>

Inheritance diagram for QgsFeatureListModel:
Inheritance graph
[legend]
Collaboration diagram for QgsFeatureListModel:
Collaboration graph
[legend]

Classes

struct  FeatureInfo

Public Slots

void onBeginRemoveRows (const QModelIndex &parent, int first, int last)
void onEndRemoveRows (const QModelIndex &parent, int first, int last)
void onBeginInsertRows (const QModelIndex &parent, int first, int last)
void onEndInsertRows (const QModelIndex &parent, int first, int last)

Public Member Functions

 QgsFeatureListModel (QgsAttributeTableFilterModel *sourceModel, QObject *parent=NULL)
virtual ~QgsFeatureListModel ()
virtual void setSourceModel (QgsAttributeTableFilterModel *sourceModel)
QgsVectorLayerCachelayerCache ()
virtual QVariant data (const QModelIndex &index, int role) const
virtual Qt::ItemFlags flags (const QModelIndex &index) const
QgsAttributeTableModelmasterModel ()
bool setDisplayExpression (const QString expression)
QString parserErrorString ()
 Returns a detailed message about errors while parsing a QgsExpression.
QString displayExpression () const
bool featureByIndex (const QModelIndex &index, QgsFeature &feat)
QgsFeatureId idxToFid (const QModelIndex &index) const
QModelIndex fidToIdx (const QgsFeatureId fid) const
virtual QModelIndex mapToSource (const QModelIndex &proxyIndex) const
virtual QModelIndex mapFromSource (const QModelIndex &sourceIndex) const
virtual QModelIndex mapToMaster (const QModelIndex &proxyIndex) const
virtual QModelIndex mapFromMaster (const QModelIndex &sourceIndex) const
virtual QItemSelection mapSelectionFromMaster (const QItemSelection &selection) const
virtual QItemSelection mapSelectionToMaster (const QItemSelection &selection) const
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
virtual QModelIndex parent (const QModelIndex &child) const
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
QModelIndex fidToIndex (QgsFeatureId fid)
QModelIndexList fidToIndexList (QgsFeatureId fid)

Private Attributes

QgsExpressionmExpression
QgsAttributeTableFilterModelmFilterModel
QString mParserErrorString

Detailed Description

Definition at line 17 of file qgsfeaturelistmodel.h.

Constructor & Destructor Documentation

QgsFeatureListModel::QgsFeatureListModel ( QgsAttributeTableFilterModel sourceModel,
QObject *  parent = NULL 
)
explicit

Definition at line 10 of file qgsfeaturelistmodel.cpp.

References mExpression, and setSourceModel().

QgsFeatureListModel::~QgsFeatureListModel ( )
virtual

Definition at line 17 of file qgsfeaturelistmodel.cpp.

References mExpression.

Member Function Documentation

int QgsFeatureListModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Definition at line 227 of file qgsfeaturelistmodel.cpp.

QVariant QgsFeatureListModel::data ( const QModelIndex &  index,
int  role 
) const
virtual
QString QgsFeatureListModel::displayExpression ( ) const
bool QgsFeatureListModel::featureByIndex ( const QModelIndex &  index,
QgsFeature feat 
)
QModelIndex QgsFeatureListModel::fidToIdx ( const QgsFeatureId  fid) const
QModelIndex QgsFeatureListModel::fidToIndex ( QgsFeatureId  fid)
virtual

Implements QgsFeatureModel.

Definition at line 239 of file qgsfeaturelistmodel.cpp.

References mapFromMaster(), and masterModel().

Referenced by fidToIndexList().

QModelIndexList QgsFeatureListModel::fidToIndexList ( QgsFeatureId  fid)

Definition at line 244 of file qgsfeaturelistmodel.cpp.

References fidToIndex().

Qt::ItemFlags QgsFeatureListModel::flags ( const QModelIndex &  index) const
virtual

Definition at line 98 of file qgsfeaturelistmodel.cpp.

References mapToSource().

QgsFeatureId QgsFeatureListModel::idxToFid ( const QModelIndex &  index) const
QModelIndex QgsFeatureListModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
virtual
QgsVectorLayerCache * QgsFeatureListModel::layerCache ( )
QModelIndex QgsFeatureListModel::mapFromMaster ( const QModelIndex &  sourceIndex) const
virtual
QModelIndex QgsFeatureListModel::mapFromSource ( const QModelIndex &  sourceIndex) const
virtual

Definition at line 207 of file qgsfeaturelistmodel.cpp.

QItemSelection QgsFeatureListModel::mapSelectionFromMaster ( const QItemSelection &  selection) const
virtual

Definition at line 187 of file qgsfeaturelistmodel.cpp.

References mFilterModel.

Referenced by QgsFeatureListView::editSelectionChanged().

QItemSelection QgsFeatureListModel::mapSelectionToMaster ( const QItemSelection &  selection) const
virtual

Definition at line 192 of file qgsfeaturelistmodel.cpp.

References mFilterModel.

QModelIndex QgsFeatureListModel::mapToMaster ( const QModelIndex &  proxyIndex) const
virtual
QModelIndex QgsFeatureListModel::mapToSource ( const QModelIndex &  proxyIndex) const
virtual

Definition at line 199 of file qgsfeaturelistmodel.cpp.

Referenced by data(), and flags().

QgsAttributeTableModel * QgsFeatureListModel::masterModel ( )
void QgsFeatureListModel::onBeginInsertRows ( const QModelIndex &  parent,
int  first,
int  last 
)
slot

Definition at line 158 of file qgsfeaturelistmodel.cpp.

Referenced by setSourceModel().

void QgsFeatureListModel::onBeginRemoveRows ( const QModelIndex &  parent,
int  first,
int  last 
)
slot

Definition at line 145 of file qgsfeaturelistmodel.cpp.

Referenced by setSourceModel().

void QgsFeatureListModel::onEndInsertRows ( const QModelIndex &  parent,
int  first,
int  last 
)
slot

Definition at line 163 of file qgsfeaturelistmodel.cpp.

Referenced by setSourceModel().

void QgsFeatureListModel::onEndRemoveRows ( const QModelIndex &  parent,
int  first,
int  last 
)
slot

Definition at line 150 of file qgsfeaturelistmodel.cpp.

Referenced by setSourceModel().

QModelIndex QgsFeatureListModel::parent ( const QModelIndex &  child) const
virtual

Definition at line 221 of file qgsfeaturelistmodel.cpp.

QString QgsFeatureListModel::parserErrorString ( )

Returns a detailed message about errors while parsing a QgsExpression.

Returns
A message containg information about the parser error.

Definition at line 130 of file qgsfeaturelistmodel.cpp.

References mParserErrorString.

Referenced by QgsFeatureListView::parserErrorString().

int QgsFeatureListModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
virtual

Definition at line 233 of file qgsfeaturelistmodel.cpp.

Referenced by QgsFeatureListView::selectAll(), and setDisplayExpression().

bool QgsFeatureListModel::setDisplayExpression ( const QString  expression)
Parameters
expressionA QgsExpression compatible string.
Returns
true if the expression could be set, false if there was a parse error. If it fails, the old expression will still be applied. Call parserErrorString() for a meaningful error message.

Definition at line 108 of file qgsfeaturelistmodel.cpp.

References QgsVectorLayer::dataProvider(), QgsVectorDataProvider::fields(), QgsExpression::hasParserError(), index(), QgsAttributeTableFilterModel::layer(), mExpression, mFilterModel, mParserErrorString, QgsExpression::parserErrorString(), QgsExpression::prepare(), and rowCount().

Referenced by QgsFeatureListView::setDisplayExpression().

void QgsFeatureListModel::setSourceModel ( QgsAttributeTableFilterModel sourceModel)
virtual

Member Data Documentation

QgsExpression* QgsFeatureListModel::mExpression
private
QgsAttributeTableFilterModel* QgsFeatureListModel::mFilterModel
private
QString QgsFeatureListModel::mParserErrorString
private

Definition at line 91 of file qgsfeaturelistmodel.h.

Referenced by parserErrorString(), and setDisplayExpression().


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