25 setModel( mFieldProxyModel );
27 connect(
this, SIGNAL( activated(
int ) ),
this, SLOT(
indexChanged(
int ) ) );
59 QModelIndex proxyIdx = mFieldProxyModel->mapFromSource( idx );
60 if ( proxyIdx.isValid() )
62 setCurrentIndex( idx.row() );
67 setCurrentIndex( -1 );
72 int i = currentIndex();
74 const QModelIndex proxyIndex = mFieldProxyModel->index( i, 0 );
75 if ( !proxyIndex.isValid() )
Base class for all map layer types.
QgsFieldModel * sourceFieldModel()
sourceFieldModel returns the QgsFieldModel used in this QSortFilterProxyModel
QString currentField() const
return the currently selected field
QgsFieldComboBox(QWidget *parent=0)
QgsFieldComboBox creates a combo box to display the fields of a layer.
void setLayer(QgsVectorLayer *layer)
set the layer of which the fields are listed
void fieldChanged(QString fieldName)
the signal is emitted when the currently selected field changes
void setFilters(QgsFieldProxyModel::Filters filters)
setFilters allows fitering according to the type of field
QgsVectorLayer * layer()
returns the currently used layer
The QgsFieldProxyModel class provides an easy to use model to display the list of fields of a layer...
QgsFieldProxyModel * setFilters(Filters filters)
setFilters set flags that affect how fields are filtered
void setLayer(QgsVectorLayer *layer)
set the layer of whch fields are displayed
void setField(QString fieldName)
setField sets the currently selected field
QgsFieldProxyModel::Filters filters() const
currently used filter on list of fields
QModelIndex indexFromName(const QString &fieldName)
return the index corresponding to a given fieldName
QgsVectorLayer * layer() const
Returns the currently used layer.
Represents a vector layer which manages a vector based data sets.