2013-06-22 19:37:41 +02:00
|
|
|
class QgsFeatureListView : QListView
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsfeaturelistview.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a feature list view
|
|
|
|
*
|
|
|
|
* @param parent owner
|
|
|
|
*/
|
|
|
|
explicit QgsFeatureListView( QWidget* parent = 0 );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
|
|
|
virtual ~QgsFeatureListView();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the layer cache
|
|
|
|
* @return the layer cache used as backend
|
|
|
|
*/
|
|
|
|
QgsVectorLayerCache* layerCache();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the {@link QgsFeatureListModel} which is used to retrieve information
|
|
|
|
*
|
|
|
|
* @param featureListModel The model to use
|
|
|
|
*/
|
|
|
|
virtual void setModel( QgsFeatureListModel* featureListModel );
|
|
|
|
/**
|
|
|
|
* Get the featureListModel used by this view
|
|
|
|
*
|
|
|
|
* @return The model in use
|
|
|
|
*/
|
|
|
|
QgsFeatureListModel* featureListModel();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The display expression is an expression used to render the fields into a single string
|
|
|
|
* which is displaied.
|
|
|
|
*
|
|
|
|
* @param displayExpression The expression used to render the feature
|
|
|
|
*
|
|
|
|
* @see QgsExpression
|
|
|
|
*/
|
|
|
|
bool setDisplayExpression( const QString displayExpression );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the expression which is currently used to render the features.
|
|
|
|
*
|
|
|
|
* @return A string containing the currend display expression
|
|
|
|
*
|
|
|
|
* @see QgsExpression
|
|
|
|
*/
|
2014-01-26 18:35:21 +01:00
|
|
|
const QString displayExpression() const;
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a detailed message about errors while parsing a QgsExpression.
|
|
|
|
*
|
|
|
|
* @return A message containg information about the parser error.
|
|
|
|
*/
|
|
|
|
QString parserErrorString();
|
|
|
|
|
2014-01-26 18:35:21 +01:00
|
|
|
/**
|
|
|
|
* Get the currentEditSelection
|
|
|
|
*
|
|
|
|
* @return A list of edited feature ids
|
|
|
|
*/
|
|
|
|
QgsFeatureIds currentEditSelection();
|
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
/**
|
|
|
|
* Sets if the currently shown form has received any edit events so far.
|
|
|
|
*
|
|
|
|
* @param state The state
|
|
|
|
*/
|
|
|
|
void setCurrentFeatureEdited( bool state );
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
protected:
|
|
|
|
virtual void mouseMoveEvent( QMouseEvent *event );
|
|
|
|
virtual void mousePressEvent( QMouseEvent *event );
|
|
|
|
virtual void mouseReleaseEvent( QMouseEvent *event );
|
|
|
|
virtual void keyPressEvent( QKeyEvent *event );
|
|
|
|
|
|
|
|
signals:
|
|
|
|
/**
|
|
|
|
* Is emitted, whenever the current edit selection has been changed.
|
|
|
|
*
|
|
|
|
* @param feat the feature, which will be edited.
|
|
|
|
*/
|
|
|
|
void currentEditSelectionChanged( QgsFeature &feat );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is emitted, whenever the display expression is successfully changed
|
|
|
|
* @param expression The expression that was applied
|
|
|
|
*/
|
|
|
|
void displayExpressionChanged( const QString expression );
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
/**
|
|
|
|
* Set the feature(s) to be edited
|
|
|
|
*
|
|
|
|
* @param fids A list of features to be edited
|
|
|
|
*/
|
|
|
|
void setEditSelection( const QgsFeatureIds &fids );
|
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
/**
|
|
|
|
* Set the feature(s) to be edited
|
|
|
|
*
|
|
|
|
* @param index The selection to set
|
|
|
|
* @param command selection update mode
|
|
|
|
*/
|
|
|
|
void setEditSelection( const QModelIndex& index, QItemSelectionModel::SelectionFlags command );
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
/**
|
|
|
|
* Select all currently visible features
|
|
|
|
*/
|
|
|
|
virtual void selectAll();
|
|
|
|
|
|
|
|
void repaintRequested( QModelIndexList indexes );
|
|
|
|
void repaintRequested();
|
|
|
|
};
|