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;
84 void setAllowEmptyLayer(
bool allowEmpty,
const QString &text = QString(),
const QIcon &icon = QIcon() );
91 bool allowEmptyLayer()
const;
98 void setShowCrs(
bool showCrs );
105 bool showCrs()
const;
114 void setAdditionalItems(
const QStringList &items );
121 QStringList additionalItems()
const;
147 void dragEnterEvent( QDragEnterEvent *event )
override;
148 void dragLeaveEvent( QDragLeaveEvent *event )
override;
149 void dropEvent( QDropEvent *event )
override;
150 void paintEvent( QPaintEvent *e )
override;
153 void indexChanged(
int i );
158 bool mDragActive =
false;
159 bool mHighlight =
false;
165 QgsMapLayer *compatibleMapLayerFromMimeData(
const QMimeData *data )
const;
167 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.
Represents a vector layer which manages a vector based data sets.