QGIS API Documentation
2.2.0-Valmiera
|
Shows a list of features and renders a edit button next to each feature. More...
#include <qgsfeaturelistview.h>
Public Slots | |
void | setEditSelection (const QgsFeatureIds &fids) |
Set the feature(s) to be edited. | |
virtual void | selectAll () |
Select all currently visible features. | |
void | repaintRequested (QModelIndexList indexes) |
void | repaintRequested () |
Signals | |
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. | |
QgsVectorLayerCache * | layerCache () |
Returns the layer cache. | |
virtual void | setModel (QgsFeatureListModel *featureListModel) |
Set the QgsFeatureListModel which is used to retrieve information. | |
QgsFeatureListModel * | featureListModel () |
Get the featureListModel used by this view. | |
bool | setDisplayExpression (const QString displayExpression) |
The display expression is an expression used to render the fields into a single string which is displaied. | |
const QString | displayExpression () const |
Returns the expression which is currently used to render the features. | |
QString | parserErrorString () |
Returns a detailed message about errors while parsing a QgsExpression. | |
QgsFeatureIds | currentEditSelection () |
Get the currentEditSelection. |
Protected Member Functions | |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
Private Slots | |
void | editSelectionChanged (QItemSelection deselected, QItemSelection selected) |
Private Member Functions | |
void | selectRow (const QModelIndex &index, bool anchor) |
Private Attributes | |
QgsFeatureListModel * | mModel |
QItemSelectionModel * | mCurrentEditSelectionModel |
QgsFeatureSelectionModel * | mFeatureSelectionModel |
QgsFeatureListViewDelegate * | mItemDelegate |
bool | mEditSelectionDrag |
int | mRowAnchor |
QItemSelectionModel::SelectionFlags | mCtrlDragSelectionFlag |
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.
|
explicit |
Creates a feature list view.
parent | owner |
Definition at line 35 of file qgsfeaturelistview.cpp.
|
inlinevirtual |
Destructor.
Definition at line 56 of file qgsfeaturelistview.h.
QgsFeatureIds QgsFeatureListView::currentEditSelection | ( | ) |
Get the currentEditSelection.
Definition at line 100 of file qgsfeaturelistview.cpp.
References QgsAttributeTableModel::FeatureIdRole, and mCurrentEditSelectionModel.
|
signal |
Is emitted, whenever the current edit selection has been changed.
feat | the feature, which will be edited. |
Referenced by editSelectionChanged().
const QString QgsFeatureListView::displayExpression | ( | ) | const |
Returns the expression which is currently used to render the features.
Definition at line 90 of file qgsfeaturelistview.cpp.
References QgsFeatureListModel::displayExpression(), and mModel.
|
signal |
Is emitted, whenever the display expression is successfully changed.
expression | The expression that was applied |
Referenced by setDisplayExpression().
|
privateslot |
Definition at line 129 of file qgsfeaturelistview.cpp.
References currentEditSelectionChanged(), QgsFeatureListModel::featureByIndex(), QgsFeatureListModel::mapFromMaster(), QgsFeatureListModel::mapSelectionFromMaster(), mCurrentEditSelectionModel, and mModel.
Referenced by setModel().
|
inline |
Get the featureListModel used by this view.
Definition at line 75 of file qgsfeaturelistview.h.
Referenced by setModel().
|
protectedvirtual |
Definition at line 224 of file qgsfeaturelistview.cpp.
References QgsFeatureListModel::index(), QgsFeatureListModel::mapFromMaster(), QgsFeatureListModel::mapToMaster(), mCurrentEditSelectionModel, and mModel.
QgsVectorLayerCache * QgsFeatureListView::layerCache | ( | ) |
Returns the layer cache.
Definition at line 45 of file qgsfeaturelistview.cpp.
References QgsFeatureListModel::layerCache(), and mModel.
|
protectedvirtual |
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 187 of file qgsfeaturelistview.cpp.
References index, QgsFeatureListModel::mapToMaster(), mCurrentEditSelectionModel, mEditSelectionDrag, mModel, and selectRow().
|
protectedvirtual |
Definition at line 110 of file qgsfeaturelistview.cpp.
References QgsFeatureListViewDelegate::EditElement, QgsFeatureSelectionModel::enableSync(), index, QgsFeatureListModel::mapToMaster(), mCurrentEditSelectionModel, mEditSelectionDrag, mFeatureSelectionModel, mItemDelegate, mModel, QgsFeatureListViewDelegate::positionToElement(), repaintRequested(), and selectRow().
|
protectedvirtual |
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 210 of file qgsfeaturelistview.cpp.
References QgsFeatureSelectionModel::enableSync(), mEditSelectionDrag, and mFeatureSelectionModel.
QString QgsFeatureListView::parserErrorString | ( | ) |
Returns a detailed message about errors while parsing a QgsExpression.
Definition at line 95 of file qgsfeaturelistview.cpp.
References mModel, and QgsFeatureListModel::parserErrorString().
|
slot |
Definition at line 168 of file qgsfeaturelistview.cpp.
References index.
|
slot |
Definition at line 176 of file qgsfeaturelistview.cpp.
Referenced by mousePressEvent(), and setModel().
|
virtualslot |
Select all currently visible features.
Definition at line 148 of file qgsfeaturelistview.cpp.
References QgsFeatureListModel::index(), mFeatureSelectionModel, mModel, QgsFeatureListModel::rowCount(), and QgsFeatureSelectionModel::selectFeatures().
|
private |
Definition at line 270 of file qgsfeaturelistview.cpp.
References QgsFeatureSelectionModel::isSelected(), mCtrlDragSelectionFlag, mFeatureSelectionModel, mRowAnchor, and QgsFeatureSelectionModel::selectFeatures().
Referenced by mouseMoveEvent(), and mousePressEvent().
bool QgsFeatureListView::setDisplayExpression | ( | const QString | displayExpression | ) |
The display expression is an expression used to render the fields into a single string which is displaied.
displayExpression | The expression used to render the feature |
Definition at line 77 of file qgsfeaturelistview.cpp.
References displayExpressionChanged(), mModel, and QgsFeatureListModel::setDisplayExpression().
|
slot |
Set the feature(s) to be edited.
fids | A list of features to be edited |
Definition at line 156 of file qgsfeaturelistview.cpp.
References QgsFeatureListModel::fidToIdx(), QgsFeatureListModel::mapToMaster(), mCurrentEditSelectionModel, and mModel.
|
virtual |
Set the QgsFeatureListModel which is used to retrieve information.
featureListModel | The model to use |
Definition at line 50 of file qgsfeaturelistview.cpp.
References editSelectionChanged(), featureListModel(), QgsVectorLayerCache::layer(), QgsFeatureListModel::layerCache(), QgsFeatureListModel::masterModel(), mCurrentEditSelectionModel, mFeatureSelectionModel, mItemDelegate, mModel, repaintRequested(), QgsFeatureListViewDelegate::setEditSelectionModel(), and QgsFeatureListViewDelegate::setFeatureSelectionModel().
|
private |
Definition at line 158 of file qgsfeaturelistview.h.
Referenced by selectRow().
|
private |
Definition at line 153 of file qgsfeaturelistview.h.
Referenced by currentEditSelection(), editSelectionChanged(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), setEditSelection(), and setModel().
|
private |
Definition at line 156 of file qgsfeaturelistview.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
private |
Definition at line 154 of file qgsfeaturelistview.h.
Referenced by mousePressEvent(), mouseReleaseEvent(), selectAll(), selectRow(), and setModel().
|
private |
Definition at line 155 of file qgsfeaturelistview.h.
Referenced by mousePressEvent(), and setModel().
|
private |
Definition at line 152 of file qgsfeaturelistview.h.
Referenced by displayExpression(), editSelectionChanged(), keyPressEvent(), layerCache(), mouseMoveEvent(), mousePressEvent(), parserErrorString(), selectAll(), setDisplayExpression(), setEditSelection(), and setModel().
|
private |
Definition at line 157 of file qgsfeaturelistview.h.
Referenced by selectRow().