QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
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
 
void editLastFeature ()
 editLastFeature will try to edit the last feature of the list
 
void editNextFeature ()
 editNextFeature will try to edit next feature of the list
 
void editPreviousFeature ()
 editPreviousFeature will try to edit previous feature of the list
 
void repaintRequested ()
 
void repaintRequested (const QModelIndexList &indexes)
 
void selectAll () override
 Select all currently visible features.
 
void setEditSelection (const QgsFeatureIds &fids)
 Set the feature(s) to be edited.
 
void setEditSelection (const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
 Set the feature(s) to be edited.
 

Signals

void aboutToChangeEditSelection (bool &ok)
 
void currentEditSelectionChanged (QgsFeature &feat)
 Emitted whenever the current edit selection has been changed.
 
void currentEditSelectionProgressChanged (int progress, int count)
 Emitted whenever the current edit selection has been changed.
 
void displayExpressionChanged (const QString &expression)
 Emitted whenever the display expression is successfully changed.
 
void willShowContextMenu (QgsActionMenu *menu, const QModelIndex &atIndex)
 Emitted when the context menu is created to add the specific actions to it.
 

Public Member Functions

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

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 34 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 391 of file qgsfeaturelistview.cpp.

◆ currentEditSelection()

QgsFeatureIds QgsFeatureListView::currentEditSelection ( )

Gets the currentEditSelection.

Returns
A list of edited feature ids

Definition at line 127 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 117 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 201 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 219 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 207 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 213 of file qgsfeaturelistview.h.

◆ featureListModel()

QgsFeatureListModel * QgsFeatureListView::featureListModel ( )
inline

Gets the featureListModel used by this view.

Returns
The model in use

Definition at line 85 of file qgsfeaturelistview.h.

◆ keyPressEvent()

void QgsFeatureListView::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Definition at line 335 of file qgsfeaturelistview.cpp.

◆ layerCache()

QgsVectorLayerCache * QgsFeatureListView::layerCache ( )

Returns the layer cache.

Returns
the layer cache used as backend

Definition at line 56 of file qgsfeaturelistview.cpp.

◆ mouseMoveEvent()

void QgsFeatureListView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 281 of file qgsfeaturelistview.cpp.

◆ mousePressEvent()

void QgsFeatureListView::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 144 of file qgsfeaturelistview.cpp.

◆ mouseReleaseEvent()

void QgsFeatureListView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

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

◆ repaintRequested [1/2]

void QgsFeatureListView::repaintRequested ( )
slot

Definition at line 276 of file qgsfeaturelistview.cpp.

◆ repaintRequested [2/2]

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

Definition at line 267 of file qgsfeaturelistview.cpp.

◆ selectAll

void QgsFeatureListView::selectAll ( )
overrideslot

Select all currently visible features.

Definition at line 218 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 138 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 104 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 226 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 252 of file qgsfeaturelistview.cpp.

◆ setFeatureSelectionManager()

void QgsFeatureListView::setFeatureSelectionManager ( QgsIFeatureSelectionManager featureSelectionManager)

setFeatureSelectionManager

Parameters
featureSelectionManager

Definition at line 554 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 61 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 Symbol Documentation

◆ QgsDualView

friend class QgsDualView
friend

Definition at line 274 of file qgsfeaturelistview.h.


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