QGIS API Documentation  2.9.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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>

Public Slots

void repaintRequested (QModelIndexList indexes)
void repaintRequested ()
virtual 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)
 Is emitted, whenever the current edit selection has been changed.
void displayExpressionChanged (const QString expression)
 Is emitted, whenever the display expression is successfully changed.

Public Member Functions

 QgsFeatureListView (QWidget *parent=0)
 Creates a feature list view.
virtual ~QgsFeatureListView ()
 Destructor.
QgsFeatureIds currentEditSelection ()
 Get the currentEditSelection.
const QString displayExpression () const
 Returns the expression which is currently used to render the features.
QgsFeatureListModelfeatureListModel ()
 Get 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.
virtual void setModel (QgsFeatureListModel *featureListModel)
 Set the QgsFeatureListModel which is used to retrieve information.

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 41 of file qgsfeaturelistview.h.

Constructor & Destructor Documentation

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

Creates a feature list view.

Parameters
parentowner

Definition at line 36 of file qgsfeaturelistview.cpp.

virtual QgsFeatureListView::~QgsFeatureListView ( )
inlinevirtual

Destructor.

Definition at line 56 of file qgsfeaturelistview.h.

Member Function Documentation

void QgsFeatureListView::aboutToChangeEditSelection ( bool &  ok)
signal
void QgsFeatureListView::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotectedvirtual

Definition at line 303 of file qgsfeaturelistview.cpp.

QgsFeatureIds QgsFeatureListView::currentEditSelection ( )

Get the currentEditSelection.

Returns
A list of edited feature ids

Definition at line 103 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::currentEditSelectionChanged ( QgsFeature feat)
signal

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

Parameters
featthe feature, which will be edited.
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 93 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::displayExpressionChanged ( const QString  expression)
signal

Is emitted, whenever the display expression is successfully changed.

Parameters
expressionThe expression that was applied
QgsFeatureListModel* QgsFeatureListView::featureListModel ( )
inline

Get the featureListModel used by this view.

Returns
The model in use

Definition at line 75 of file qgsfeaturelistview.h.

void QgsFeatureListView::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Definition at line 257 of file qgsfeaturelistview.cpp.

QgsVectorLayerCache * QgsFeatureListView::layerCache ( )

Returns the layer cache.

Returns
the layer cache used as backend

Definition at line 48 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

This function is called with the given event when a mouse move event is sent to the widget. If a selection is in progress and new items are moved over the selection is extended; if a drag is in progress it is continued.

Definition at line 220 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 119 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

This function is called with the given event when a mouse button is released, after a mouse press event on the widget. If a user presses the mouse inside your widget and then drags the mouse to another location before releasing the mouse button, your widget receives the release event. The function will emit the clicked() signal if an item was being pressed.

Definition at line 243 of file qgsfeaturelistview.cpp.

QString QgsFeatureListView::parserErrorString ( )

Returns a detailed message about errors while parsing a QgsExpression.

Returns
A message containg information about the parser error.

Definition at line 98 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::repaintRequested ( QModelIndexList  indexes)
slot

Definition at line 201 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::repaintRequested ( )
slot

Definition at line 209 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::selectAll ( )
overridevirtualslot

Select all currently visible features.

Definition at line 168 of file qgsfeaturelistview.cpp.

void QgsFeatureListView::setCurrentFeatureEdited ( bool  state)

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

Parameters
stateThe state

Definition at line 113 of file qgsfeaturelistview.cpp.

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

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

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

void QgsFeatureListView::setModel ( QgsFeatureListModel featureListModel)
virtual

Set the QgsFeatureListModel which is used to retrieve information.

Parameters
featureListModelThe model to use

Definition at line 53 of file qgsfeaturelistview.cpp.


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