QGIS API Documentation  2.99.0-Master (f1c3692)
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsFeatureListView Class Reference

Shows a list of features and renders a edit button next to each feature. More...

#include <qgsfeaturelistview.h>

Inheritance diagram for QgsFeatureListView:
Inheritance graph
[legend]

Public Slots

void repaintRequested (const QModelIndexList &indexes)
 
void repaintRequested ()
 
virtual void selectAll () override
 Select all currently visible features. More...
 
void setEditSelection (const QgsFeatureIds &fids)
 Set the feature(s) to be edited. More...
 
void setEditSelection (const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
 Set the feature(s) to be edited. More...
 

Signals

void aboutToChangeEditSelection (bool &ok)
 
void currentEditSelectionChanged (QgsFeature &feat)
 Is emitted, whenever the current edit selection has been changed. More...
 
void displayExpressionChanged (const QString &expression)
 Is emitted, whenever the display expression is successfully changed. More...
 

Public Member Functions

 QgsFeatureListView (QWidget *parent=0)
 Creates a feature list view. More...
 
QgsFeatureIds currentEditSelection ()
 Get the currentEditSelection. More...
 
const QString displayExpression () const
 Returns the expression which is currently used to render the features. More...
 
QgsFeatureListModelfeatureListModel ()
 Get the featureListModel used by this view. More...
 
QgsVectorLayerCachelayerCache ()
 Returns the layer cache. More...
 
QString parserErrorString ()
 Returns a detailed message about errors while parsing a QgsExpression. More...
 
void setCurrentFeatureEdited (bool state)
 Sets if the currently shown form has received any edit events so far. More...
 
bool setDisplayExpression (const QString &displayExpression)
 The display expression is an expression used to render the fields into a single string which is displaied. More...
 
void setFeatureSelectionManager (QgsIFeatureSelectionManager *featureSelectionManager)
 setFeatureSelectionManager More...
 
virtual void setModel (QgsFeatureListModel *featureListModel)
 Set the QgsFeatureListModel which is used to retrieve information. More...
 

Protected Member Functions

virtual void contextMenuEvent (QContextMenuEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 

Detailed Description

Shows a list of features and renders a edit button next to each feature.

Accepts a display expression to define the way, features are rendered. Uses a QgsFeatureListModel as source model.

Definition at line 45 of file qgsfeaturelistview.h.

Constructor & Destructor Documentation

◆ QgsFeatureListView()

QgsFeatureListView::QgsFeatureListView ( QWidget *  parent = 0)
explicit

Creates a feature list view.

Parameters
parentowner

Definition at line 36 of file qgsfeaturelistview.cpp.

Member Function Documentation

◆ aboutToChangeEditSelection

void QgsFeatureListView::aboutToChangeEditSelection ( bool &  ok)
signal
Note
not available in Python bindings

◆ contextMenuEvent()

void QgsFeatureListView::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotectedvirtual

Definition at line 292 of file qgsfeaturelistview.cpp.

◆ currentEditSelection()

QgsFeatureIds QgsFeatureListView::currentEditSelection ( )

Get the currentEditSelection.

Returns
A list of edited feature ids

Definition at line 104 of file qgsfeaturelistview.cpp.

◆ currentEditSelectionChanged

void QgsFeatureListView::currentEditSelectionChanged ( QgsFeature feat)
signal

Is emitted, whenever the current edit selection has been changed.

Parameters
featthe feature, which will be edited.

◆ displayExpression()

const QString QgsFeatureListView::displayExpression ( ) const

Returns the expression which is currently used to render the features.

Returns
A string containing the currend display expression
See also
QgsExpression

Definition at line 94 of file qgsfeaturelistview.cpp.

◆ displayExpressionChanged

void QgsFeatureListView::displayExpressionChanged ( const QString &  expression)
signal

Is emitted, whenever the display expression is successfully changed.

Parameters
expressionThe expression that was applied

◆ featureListModel()

QgsFeatureListModel* QgsFeatureListView::featureListModel ( )
inline

Get the featureListModel used by this view.

Returns
The model in use

Definition at line 76 of file qgsfeaturelistview.h.

◆ keyPressEvent()

void QgsFeatureListView::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Definition at line 246 of file qgsfeaturelistview.cpp.

◆ layerCache()

QgsVectorLayerCache * QgsFeatureListView::layerCache ( )

Returns the layer cache.

Returns
the layer cache used as backend

Definition at line 42 of file qgsfeaturelistview.cpp.

◆ mouseMoveEvent()

void QgsFeatureListView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 215 of file qgsfeaturelistview.cpp.

◆ mousePressEvent()

void QgsFeatureListView::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 120 of file qgsfeaturelistview.cpp.

◆ mouseReleaseEvent()

void QgsFeatureListView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 231 of file qgsfeaturelistview.cpp.

◆ parserErrorString()

QString QgsFeatureListView::parserErrorString ( )

Returns a detailed message about errors while parsing a QgsExpression.

Returns
A message containing information about the parser error.

Definition at line 99 of file qgsfeaturelistview.cpp.

◆ repaintRequested [1/2]

void QgsFeatureListView::repaintRequested ( const QModelIndexList &  indexes)
slot

Definition at line 202 of file qgsfeaturelistview.cpp.

◆ repaintRequested [2/2]

void QgsFeatureListView::repaintRequested ( )
slot

Definition at line 210 of file qgsfeaturelistview.cpp.

◆ selectAll

void QgsFeatureListView::selectAll ( )
overridevirtualslot

Select all currently visible features.

Definition at line 169 of file qgsfeaturelistview.cpp.

◆ setCurrentFeatureEdited()

void QgsFeatureListView::setCurrentFeatureEdited ( bool  state)

Sets if the currently shown form has received any edit events so far.

Parameters
stateThe state

Definition at line 114 of file qgsfeaturelistview.cpp.

◆ setDisplayExpression()

bool QgsFeatureListView::setDisplayExpression ( const QString &  displayExpression)

The display expression is an expression used to render the fields into a single string which is displaied.

Parameters
displayExpressionThe expression used to render the feature
See also
QgsExpression

Definition at line 81 of file qgsfeaturelistview.cpp.

◆ setEditSelection [1/2]

void QgsFeatureListView::setEditSelection ( const QgsFeatureIds fids)
slot

Set the feature(s) to be edited.

Parameters
fidsA list of features to be edited

Definition at line 177 of file qgsfeaturelistview.cpp.

◆ setEditSelection [2/2]

void QgsFeatureListView::setEditSelection ( const QModelIndex &  index,
QItemSelectionModel::SelectionFlags  command 
)
slot

Set the feature(s) to be edited.

Parameters
indexThe selection to set
commandselection update mode

Definition at line 193 of file qgsfeaturelistview.cpp.

◆ setFeatureSelectionManager()

void QgsFeatureListView::setFeatureSelectionManager ( QgsIFeatureSelectionManager featureSelectionManager)

setFeatureSelectionManager

Parameters
featureSelectionManagerWe will take ownership

Definition at line 331 of file qgsfeaturelistview.cpp.

◆ setModel()

void QgsFeatureListView::setModel ( QgsFeatureListModel featureListModel)
virtual

Set the QgsFeatureListModel which is used to retrieve information.

Parameters
featureListModelThe model to use

Definition at line 47 of file qgsfeaturelistview.cpp.


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