29 #include <QHBoxLayout>
35 , mEditorContext( context )
36 , mRelation( relation )
58 editor->mToggleEditingButton->setEnabled( canChangeAttributes && !lyr->
isReadOnly() );
63 editor->mBrowserWidget->layout()->addWidget( dualView );
74 connect( editor->mViewModeButtonGroup, SIGNAL( buttonClicked(
int ) ), dualView, SLOT( setCurrentIndex(
int ) ) );
75 connect( dualView, SIGNAL( currentChanged(
int ) ), editor, SLOT(
viewModeChanged(
int ) ) );
92 mAddFeatureButton->setEnabled( editable );
93 mLinkFeatureButton->setEnabled( editable );
94 mDeleteFeatureButton->setEnabled( editable );
95 mUnlinkFeatureButton->setEnabled( editable );
96 mToggleEditingButton->setChecked( editable );
101 mViewModeButtonGroup->button( mode )->click();
122 if ( selectionDlg.exec() )
124 QMap<int, QVariant> keys;
129 keys.insert( idx, val );
132 foreach (
QgsFeatureId fid, selectionDlg.selectedFeatures() )
134 QMapIterator<int, QVariant> it( keys );
135 while ( it.hasNext() )
154 QMap<int, QgsField> keyFields;
159 keyFields.insert( idx, fld );
164 QMapIterator<int, QgsField> it( keyFields );
165 while ( it.hasNext() )
QMap< int, QVariant > QgsAttributeMap
void setFeatureSelectionManager(QgsIFeatureSelectionManager *featureSelectionManager)
A groupbox that collapses/expands when toggled and can save its collapsed and checked states...
bool deleteFeature(QgsFeatureId fid)
delete a feature from the layer (but does not commit it)
This class contains context information for attribute editor widgets.
void collapsedStateChanged(bool collapsed)
Signal emitted when groupbox collapsed/expanded state is changed, and when first shown.
Container of fields for a vector layer.
const QgsField & at(int i) const
Get field at particular index (must be in range 0..N-1)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Show a list of the features, where one can be chosen and the according attribute dialog will be prese...
void init(QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request=QgsFeatureRequest(), QgsAttributeEditorContext context=QgsAttributeEditorContext())
Has to be called to initialize the dual view.
Defines a relation between matchin fields of the two involved tables of a relation.
Shows the features and attributes in a table layout.
QgsVectorLayerTools * vectorLayerTools()
virtual int capabilities() const
Returns a bitmask containing the supported capabilities Note, some capabilities may change depending ...
QgsVectorLayer * referencingLayer() const
Access the referencing (child) layer This is the layer which has the field(s) which point to another ...
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Q_DECL_DEPRECATED bool changeAttributeValue(QgsFeatureId fid, int field, QVariant value, bool emitSignal)
Changes an attribute value (but does not commit it)
Encapsulate a field in an attribute table or data source.
QgsFeatureRequest getRelatedFeaturesRequest(const QgsFeature &feature) const
Creates a request to return all the features on the referencing (child) layer which have a foreign ke...
int indexFromName(const QString &name) const
Look up field's index from name. Returns -1 on error.
This selection manager synchronizes a local set of selected features with an attribute table...
QgsAttributeTableModel * masterModel() const
Returns the model which has the information about all features (not only filtered) ...
virtual bool isReadOnly() const
Returns true if the provider is in read-only mode.
virtual const QgsFeatureIds & selectedFeaturesIds() const
Return reference to identifiers of selected features.
const QString & referencingField() const
Get the name of the referencing field.
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
QgsVectorLayer * layer() const
Returns the layer this model uses as backend.
QList< FieldPair > fieldPairs() const
Returns the field pairs which form this relation The first element of each pair are the field names f...
const QgsFields & pendingFields() const
returns field list in the to-be-committed state
QgsVectorDataProvider * dataProvider()
Returns the data provider.
virtual bool isEditable() const
Returns true if the provider is in editing mode.
Represents a vector layer which manages a vector based data sets.
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
allows modification of attribute values
This widget is used to show the attributes of a set of features of a QgsVectorLayer.
const QString & referencedField() const
Get the name of the referenced field.