qgis / QGIS-Documentation

QGIS Documentation
https://docs.qgis.org/latest
477 stars 700 forks source link

PyQGIS Developer Cookbook (>=3.38): the QgsField constructor used in the examples is deprecated #9259

Closed agiudiceandrea closed 1 month ago

agiudiceandrea commented 1 month ago

Description

In various examples, a deprecated QgsField constructor (using QVariant) is used. The examples should be updated to used the non deprecated QgsField constructor (using QMetaType), instead. Probably other constructors / functions should be updated to use QMetaType.

See https://github.com/qgis/QGIS/pull/57272.

Page URL: e.g. https://docs.qgis.org/3.34/en/docs/pyqgis_developer_cookbook/vector.html#creating-vector-layers

DelazJ commented 1 month ago

@agiudiceandrea isn't this already fixed: https://github.com/qgis/QGIS-Documentation/commit/b8fd0fb38846eb80bb97ecbc41634b113296c558? Afaict this wasn't backported so 3.34 docs is not a relevant target here.

agiudiceandrea commented 1 month ago

@DelazJ you are right. I was comparing the two versions and I got confused between the two... In 3.34 Qvariant.type is not deprecated.