26 connect(
this, SIGNAL( activated(
int ) ),
this, SLOT(
indexChanged(
int ) ) );
39 QModelIndex proxyIdx =
mProxyModel->mapFromSource( idx );
40 if ( proxyIdx.isValid() )
42 setCurrentIndex( proxyIdx.row() );
47 setCurrentIndex( -1 );
53 int i = currentIndex();
55 const QModelIndex proxyIndex =
mProxyModel->index( i, 0 );
56 if ( !proxyIndex.isValid() )
62 if ( !index.isValid() )
Base class for all map layer types.
QgsMapLayerModel * sourceLayerModel()
layerModel returns the QgsMapLayerModel used in this QSortFilterProxyModel
void layerChanged(QgsMapLayer *layer)
layerChanged this signal is emitted whenever the currently selected layer changes ...
void setFilters(QgsMapLayerProxyModel::Filters filters)
setFilters allows fitering according to layer type and/or geometry type.
The QgsMapLayerProxModel class provides an easy to use model to display the list of layers in widgets...
QgsMapLayerProxyModel * mProxyModel
void setLayer(QgsMapLayer *layer)
setLayer set the current layer selected in the combo
QgsMapLayer * currentLayer()
currentLayer returns the current layer selected in the combo box
QModelIndex indexFromLayer(QgsMapLayer *layer)
indexFromLayer returns the model index for a given layer
QgsMapLayerProxyModel * setFilters(Filters filters)
setFilters set flags that affect how layers are filtered
QgsMapLayerComboBox(QWidget *parent=0)
QgsMapLayerComboBox creates a combo box to dislpay the list of layers (currently in the registry)...