QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | 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 editFirstFeature ()
 editFirstFeature will try to edit the first feature of the list More...
 
void editLastFeature ()
 editLastFeature will try to edit the last feature of the list More...
 
void editNextFeature ()
 editNextFeature will try to edit next feature of the list More...
 
void editPreviousFeature ()
 editPreviousFeature will try to edit previous feature of the list More...
 
void repaintRequested ()
 
void repaintRequested (const QModelIndexList &indexes)
 
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)
 Emitted whenever the current edit selection has been changed. More...
 
void currentEditSelectionProgressChanged (int progress, int count)
 Emitted whenever the current edit selection has been changed. More...
 
void displayExpressionChanged (const QString &expression)
 Emitted whenever the display expression is successfully changed. More...
 
void willShowContextMenu (QgsActionMenu *menu, const QModelIndex &atIndex)
 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
 

Friends

class QgsDualView
 

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

Definition at line 344 of file qgsfeaturelistview.cpp.

◆ currentEditSelection()

QgsFeatureIds QgsFeatureListView::currentEditSelection ( )

Gets the currentEditSelection.

Returns
A list of edited feature ids

Definition at line 113 of file qgsfeaturelistview.cpp.

◆ currentEditSelectionChanged

void QgsFeatureListView::currentEditSelectionChanged ( QgsFeature feat)
signal

Emitted whenever the current edit selection has been changed.

Parameters
featthe feature, which will be edited.

◆ currentEditSelectionProgressChanged

void QgsFeatureListView::currentEditSelectionProgressChanged ( int  progress,
int  count 
)
signal

Emitted whenever the current edit selection has been changed.

Parameters
progressthe position of the feature in the list
countthe number of features in the list
Since
QGIS 3.8

◆ 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 103 of file qgsfeaturelistview.cpp.

◆ displayExpressionChanged

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

Emitted whenever the display expression is successfully changed.

Parameters
expressionThe expression that was applied

◆ editFirstFeature

void QgsFeatureListView::editFirstFeature ( )
inlineslot

editFirstFeature will try to edit the first feature of the list

Since
QGIS 3.8

Definition at line 193 of file qgsfeaturelistview.h.

◆ editLastFeature

void QgsFeatureListView::editLastFeature ( )
inlineslot

editLastFeature will try to edit the last feature of the list

Since
QGIS 3.8

Definition at line 211 of file qgsfeaturelistview.h.

◆ editNextFeature

void QgsFeatureListView::editNextFeature ( )
inlineslot

editNextFeature will try to edit next feature of the list

Since
QGIS 3.8

Definition at line 199 of file qgsfeaturelistview.h.

◆ editPreviousFeature

void QgsFeatureListView::editPreviousFeature ( )
inlineslot

editPreviousFeature will try to edit previous feature of the list

Since
QGIS 3.8

Definition at line 205 of file qgsfeaturelistview.h.

◆ 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 288 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)
overrideprotected

Definition at line 249 of file qgsfeaturelistview.cpp.

◆ mousePressEvent()

void QgsFeatureListView::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 130 of file qgsfeaturelistview.cpp.

◆ mouseReleaseEvent()

void QgsFeatureListView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

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

◆ repaintRequested [1/2]

void QgsFeatureListView::repaintRequested ( )
slot

Definition at line 244 of file qgsfeaturelistview.cpp.

◆ repaintRequested [2/2]

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

Definition at line 235 of file qgsfeaturelistview.cpp.

◆ selectAll

void QgsFeatureListView::selectAll ( )
overrideslot

Select all currently visible features.

Definition at line 186 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 124 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 90 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 194 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 220 of file qgsfeaturelistview.cpp.

◆ setFeatureSelectionManager()

void QgsFeatureListView::setFeatureSelectionManager ( QgsIFeatureSelectionManager featureSelectionManager)

setFeatureSelectionManager

Parameters
featureSelectionManager

Definition at line 493 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.

◆ willShowContextMenu

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

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

Friends And Related Function Documentation

◆ QgsDualView

friend class QgsDualView
friend

Definition at line 252 of file qgsfeaturelistview.h.


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