Hi Pierluigi,
you need to combine the Flags as binary Or ('|') :
self.overlayLayer_ComboBox.setFilters(QgsMapLayerProxyModel.PointLayer |
QgsMapLayerProxyModel.LineLayer)
/Benjamin
On 2021-07-12 19:51, pierluigi de rosa wrote:
Dear All,
I'm experiencing some problems with the QgsMapLayerComboBox.
I would like to filter all line and polygon layer.
Here below my code:
self.overlayLayer_ComboBox.setFilters(QgsMapLayerProxyModel.PointLayer,QgsMapLayerProxyModel.LineLayer)
But I have and Error. I can add only one layer type. Even the
QgsmapLayerProxyModel.VectorLayer [1] is not suitable.
I want to show only line and polygon.
Can anyone help me?
Thank you
Pierluigi --
Ing. Pierluigi De Rosa (PhD in Earth Science)
Contract Professor of Geographic Information System at University of
Perugia
cel: 3497558268 / fax: 075 7823038
skype: pierluigi.derosa
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
--
--
Benjamin Jakimow, Doctoral Researcher
Earth Observation Lab | Geography Department | Humboldt-Universität zu
Berlin
e-mail: [email protected]
phone: +49 (0) 30 2093 6894
mobile: +49 (0) 157 5656 8477
fax: +49 (0) 30 2093 6848
mail: Unter den Linden 6 | 10099 Berlin | Germany
room: 2'222
Links:
------
[1]
https://qgis.github.io/pyqgis/3.2/core/Map/QgsMapLayerProxyModel.html?highlight=qgsmaplayerproxymodel%20pointlayer#qgis.core.QgsMapLayerProxyModel.VectorLayer_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer