QGIS API Documentation  3.2.0-Bonn (bc43194)
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 ()
 
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...
 
void willShowContextMenu (QgsActionMenu *menu, const QModelIndex &atIndex)
 Is emitted, when the context menu is created to add the specific actions to it. More...
 

Public Member Functions

 QgsFeatureListView (QWidget *parent=nullptr)
 Creates a feature list view. More...
 
QgsFeatureIds currentEditSelection ()
 Gets the currentEditSelection. More...
 
const QString displayExpression () const
 Returns the expression which is currently used to render the features. More...
 
QgsFeatureListModelfeatureListModel ()
 Gets 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

void contextMenuEvent (QContextMenuEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
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 46 of file qgsfeaturelistview.h.

Constructor & Destructor Documentation

◆ QgsFeatureListView()

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

Creates a feature list view.

Parameters
parentowner

Definition at line 35 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)
overrideprotected

Definition at line 304 of file qgsfeaturelistview.cpp.

◆ currentEditSelection()

QgsFeatureIds QgsFeatureListView::currentEditSelection ( )

Gets the currentEditSelection.

Returns
A list of edited feature ids

Definition at line 110 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 100 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

Gets the featureListModel used by this view.

Returns
The model in use

Definition at line 77 of file qgsfeaturelistview.h.

◆ keyPressEvent()

void QgsFeatureListView::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Definition at line 258 of file qgsfeaturelistview.cpp.

◆ layerCache()

QgsVectorLayerCache * QgsFeatureListView::layerCache ( )

Returns the layer cache.

Returns
the layer cache used as backend

Definition at line 41 of file qgsfeaturelistview.cpp.

◆ mouseMoveEvent()

void QgsFeatureListView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 227 of file qgsfeaturelistview.cpp.

◆ mousePressEvent()

void QgsFeatureListView::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 127 of file qgsfeaturelistview.cpp.

◆ mouseReleaseEvent()

void QgsFeatureListView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 243 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 105 of file qgsfeaturelistview.cpp.

◆ repaintRequested [1/2]

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

Definition at line 214 of file qgsfeaturelistview.cpp.

◆ repaintRequested [2/2]

void QgsFeatureListView::repaintRequested ( )
slot

Definition at line 222 of file qgsfeaturelistview.cpp.

◆ selectAll

void QgsFeatureListView::selectAll ( )
overrideslot

Select all currently visible features.

Definition at line 176 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 121 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 87 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 184 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 200 of file qgsfeaturelistview.cpp.

◆ setFeatureSelectionManager()

void QgsFeatureListView::setFeatureSelectionManager ( QgsIFeatureSelectionManager featureSelectionManager)

setFeatureSelectionManager

Parameters
featureSelectionManagerWe will take ownership

Definition at line 438 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 46 of file qgsfeaturelistview.cpp.

◆ willShowContextMenu

void QgsFeatureListView::willShowContextMenu ( QgsActionMenu menu,
const QModelIndex &  atIndex 
)
signal

Is emitted, when the context menu is created to add the specific actions to it.

Parameters
menuis the already created context menu
atIndexis the position of the current feature in the model

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