[QGIS-Developer] replacement of QgsMapLayer::LayerType by QgsMapLayerType

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[QGIS-Developer] replacement of QgsMapLayer::LayerType by QgsMapLayerType

Dear list,

A small warning that I am about to merge PR #9437

This pull request adds a new scope based enum for map layer types.
In other words, QgsMapLayer::LayerType is now QgsMapLayerType.

This change has been motivated by:
- taking the enum outside of the QgsMapLayer class:
  * allows to use forward declarations of the enum (and not including the whole qgsmaplayer.h file)
  * avoid the rather long call: QgsMapLayer::LayerType::VectorLayer (mandatory with scope based enums)

This means that current "green" pull request **might** actually need a rebase and retest.

Regarding Python API compatibility, it is kept by using monkey patching. So no worries on this side.

This follows a former merged PR that introduced a scope based enum, but this one was kept in class

So, basically to be nicely displayed in the PyQGIS API docs, all enums shall be converted to scope based enums. Then, deciding to take them out of class or not depends a bit if the enum is meant to be mainly used within the class or not.

Thanks for reading, best wishes
And have a good rebase :)



QGIS-Developer mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer