QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
QgsDualView Class Reference

This widget is used to show the attributes of a set of features of a QgsVectorLayer. More...

#include <qgsdualview.h>

Inheritance diagram for QgsDualView:
Inheritance graph
[legend]

Public Types

enum  ViewMode { AttributeTable = 0, AttributeEditor = 1 }
 The view modes, in which this widget can present information. More...
 

Public Slots

bool saveEditChanges ()
 saveEditChanges More...
 
void setCurrentEditSelection (const QgsFeatureIds &fids)
 Set the current edit selection in the AttributeEditor mode. More...
 

Signals

void displayExpressionChanged (const QString expression)
 Is emitted, whenever the display expression is successfully changed. More...
 
void filterChanged ()
 Is emitted, whenever the filter changes. More...
 

Public Member Functions

 QgsDualView (QWidget *parent=0)
 Constructor. More...
 
int featureCount ()
 Returns the number of features on the layer. More...
 
int filteredFeatureCount ()
 Returns the number of features which are currently visible, according to the filter restrictions. More...
 
QgsFeatureIds filteredFeatures ()
 
QgsAttributeTableFilterModel::FilterMode filterMode ()
 
void init (QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request=QgsFeatureRequest(), QgsAttributeEditorContext context=QgsAttributeEditorContext())
 Has to be called to initialize the dual view. More...
 
QgsAttributeTableModelmasterModel () const
 Returns the model which has the information about all features (not only filtered) More...
 
void setFeatureSelectionManager (QgsIFeatureSelectionManager *featureSelectionManager)
 
void setFilteredFeatures (QgsFeatureIds filteredFeatures)
 Set a list of currently visible features. More...
 
void setFilterMode (QgsAttributeTableFilterModel::FilterMode filterMode)
 Set the filter mode. More...
 
void setRequest (const QgsFeatureRequest &request)
 
void setSelectedOnTop (bool selectedOnTop)
 Toggle the selectedOnTop flag. More...
 
void setView (ViewMode view)
 Change the current view mode. More...
 

Protected Member Functions

void columnBoxInit ()
 Initializes widgets which depend on the attributes of this layer. More...
 

Friends

class TestQgsDualView
 

Detailed Description

This widget is used to show the attributes of a set of features of a QgsVectorLayer.

The attributes can be edited. It supports two different layouts: the table layout, in which the attributes for the features are shown in a table and the editor layout, where the features are shown as a selectable list and the attributes for the currently selected feature are shown in a form.

Definition at line 40 of file qgsdualview.h.

Member Enumeration Documentation

The view modes, in which this widget can present information.

Relates to the QStackedWidget stacks.

Enumerator
AttributeTable 

Shows the features and attributes in a table layout.

AttributeEditor 

Show a list of the features, where one can be chosen and the according attribute dialog will be presented in the neighbouring frame.

Definition at line 52 of file qgsdualview.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
parentThe parent widget

Definition at line 36 of file qgsdualview.cpp.

Member Function Documentation

void QgsDualView::columnBoxInit ( )
protected

Initializes widgets which depend on the attributes of this layer.

Definition at line 91 of file qgsdualview.cpp.

void QgsDualView::displayExpressionChanged ( const QString  expression)
signal

Is emitted, whenever the display expression is successfully changed.

Parameters
expressionThe expression that was applied
int QgsDualView::featureCount ( )

Returns the number of features on the layer.

Returns
Number of features

Definition at line 316 of file qgsdualview.cpp.

void QgsDualView::filterChanged ( )
signal

Is emitted, whenever the filter changes.

int QgsDualView::filteredFeatureCount ( )

Returns the number of features which are currently visible, according to the filter restrictions.

Returns
Number of features

Definition at line 321 of file qgsdualview.cpp.

QgsFeatureIds QgsDualView::filteredFeatures ( )
inline

Definition at line 130 of file qgsdualview.h.

QgsAttributeTableFilterModel::FilterMode QgsDualView::filterMode ( )
inline

Definition at line 97 of file qgsdualview.h.

void QgsDualView::init ( QgsVectorLayer layer,
QgsMapCanvas mapCanvas,
const QgsFeatureRequest request = QgsFeatureRequest(),
QgsAttributeEditorContext  context = QgsAttributeEditorContext() 
)

Has to be called to initialize the dual view.

Parameters
layerThe layer which should be used to fetch features
mapCanvasThe mapCanvas (used for the FilterMode QgsAttributeTableFilterModel::ShowVisible
requestUse a modified request to limit the shown features
contextThe context in which this view is shown

Definition at line 63 of file qgsdualview.cpp.

QgsAttributeTableModel* QgsDualView::masterModel ( ) const
inline

Returns the model which has the information about all features (not only filtered)

Returns
The master model

Definition at line 137 of file qgsdualview.h.

bool QgsDualView::saveEditChanges ( )
slot

saveEditChanges

Returns
true if the saving was ok. false is possible due to connected validation logic.

Definition at line 267 of file qgsdualview.cpp.

void QgsDualView::setCurrentEditSelection ( const QgsFeatureIds fids)
slot

Set the current edit selection in the AttributeEditor mode.

Parameters
fidsA list of edited features (Currently only one at a time is supported)

Definition at line 261 of file qgsdualview.cpp.

void QgsDualView::setFeatureSelectionManager ( QgsIFeatureSelectionManager featureSelectionManager)

Definition at line 389 of file qgsdualview.cpp.

void QgsDualView::setFilteredFeatures ( QgsFeatureIds  filteredFeatures)

Set a list of currently visible features.

Parameters
filteredFeaturesA list of feature ids

Definition at line 379 of file qgsdualview.cpp.

void QgsDualView::setFilterMode ( QgsAttributeTableFilterModel::FilterMode  filterMode)

Set the filter mode.

Parameters
filterMode

Definition at line 193 of file qgsdualview.cpp.

void QgsDualView::setRequest ( const QgsFeatureRequest request)

Definition at line 384 of file qgsdualview.cpp.

void QgsDualView::setSelectedOnTop ( bool  selectedOnTop)

Toggle the selectedOnTop flag.

If enabled, selected features will be moved to top.

Parameters
selectedOnTopTrue: Show selected features on top. False: Use defined sorting column.

Definition at line 199 of file qgsdualview.cpp.

void QgsDualView::setView ( QgsDualView::ViewMode  view)

Change the current view mode.

Parameters
viewThe view mode to set

Definition at line 188 of file qgsdualview.cpp.

Friends And Related Function Documentation

friend class TestQgsDualView
friend

Definition at line 235 of file qgsdualview.h.


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