Dear list,

A small warning that I am about to merge PR #9437
https://github.com/qgis/QGIS/pull/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:
- scope based enums are nicely displayed in the PyQGIS docs (see
https://qgis.org/pyqgis/master/gui/QgsAdvancedDigitizingDockWidget.html#qgis.gui.QgsAdvancedDigitizingDockWidget.AdditionalConstraint
 )
- 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
https://github.com/qgis/QGIS/pull/9425

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 :)

Denis


-- 

Denis Rouzaud
de...@opengis.ch  <de...@opengis.ch>
+41 76 370 21 22
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to