Bug report #20156

QgsVectorFileWriter creates new fields with field type Integer64 instead of Integer.

Added by Evangelos Rozos over 5 years ago.

Affected QGIS version:3.2.3 Regression?:No
Operating System:Windows 10 64 bit Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27977


The data type of the third argument of QgsVectorFileWriter is QgsFields [1], a container of fields. Suppose an entry (data type of entries is Qgsfield, see [2]) of this container has QVariant Type = QVariant.Int. Then, the type of corresponding field in the created attribute table will be QVariant.LongLong [3], instead of Integer.

[1] https://qgis.org/api/classQgsVectorFileWriter.html
[2] https://qgis.org/api/classQgsField.html
[3] http://pyqt.sourceforge.net/Docs/PyQt4/qvariant.html

Also available in: Atom PDF