16#ifndef QGSMAPLAYERCOMBOBOX_H
17#define QGSMAPLAYERCOMBOBOX_H
37 Q_PROPERTY( QgsMapLayerProxyModel::Filters filters READ filters WRITE setFilters )
38 Q_PROPERTY(
bool allowEmptyLayer READ allowEmptyLayer WRITE setAllowEmptyLayer )
39 Q_PROPERTY(
bool showCrs READ showCrs WRITE setShowCrs )
40 Q_PROPERTY( QStringList excludedProviders READ excludedProviders WRITE setExcludedProviders )
51 void setFilters( QgsMapLayerProxyModel::Filters filters ) { mProxyModel->setFilters( filters ); }
54 QgsMapLayerProxyModel::Filters
filters()
const {
return mProxyModel->filters(); }
57 void setExceptedLayerList(
const QList<QgsMapLayer *> &layerList ) { mProxyModel->setExceptedLayerList( layerList );}
67 void setExcludedProviders(
const QStringList &providers );
74 QStringList excludedProviders()
const;
94 void setAllowEmptyLayer(
bool allowEmpty,
const QString &text = QString(),
const QIcon &icon = QIcon() );
101 bool allowEmptyLayer()
const;
108 void setShowCrs(
bool showCrs );
115 bool showCrs()
const;
124 void setAdditionalItems(
const QStringList &items );
131 QStringList additionalItems()
const;
142 void setAdditionalLayers(
const QList<QgsMapLayer *> &layers );
150 QList< QgsMapLayer * > additionalLayers()
const;
176 void dragEnterEvent( QDragEnterEvent *event )
override;
177 void dragLeaveEvent( QDragLeaveEvent *event )
override;
178 void dropEvent( QDropEvent *event )
override;
179 void paintEvent( QPaintEvent *e )
override;
182 void indexChanged(
int i );
187 bool mDragActive =
false;
188 bool mHighlight =
false;
194 QgsMapLayer *compatibleMapLayerFromMimeData(
const QMimeData *data )
const;
196 friend class QgsProcessingMapLayerComboBox;
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
void setFilters(QgsMapLayerProxyModel::Filters filters)
setFilters allows filtering according to layer type and/or geometry type.
QList< QgsMapLayer * > exceptedLayerList() const
returns the list of excepted layers
void setExceptedLayerList(const QList< QgsMapLayer * > &layerList)
except a list of layers not to be listed
QgsMapLayerProxyModel::Filters filters() const
currently used filter on list layers
void layerChanged(QgsMapLayer *layer)
Emitted whenever the currently selected layer changes.
The QgsMapLayerProxyModel class provides an easy to use model to display the list of layers in widget...
Base class for all map layer types.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Represents a vector layer which manages a vector based data sets.