[QGIS-trac] Re: [Quantum GIS] #2378: addAttribute() doesn't work
Quantum GIS
qgis at qgis.org
Tue Jan 19 07:10:53 EST 2010
#2378: addAttribute() doesn't work
-----------------------------------------------------+----------------------
Reporter: trapanator | Owner:
Type: bug | Status: new
Priority: major: does not work as expected | Milestone: Version 1.5.0
Component: Python plugins and bindings | Version: HEAD
Resolution: | Keywords:
Platform_version: | Platform: Debian
Must_fix: Yes | Status_info: 0
-----------------------------------------------------+----------------------
Comment (by wonder):
addAttribute() method expects QVariant instance, not QString. So this
should work:
{{{
feat.addAttribute (x, QVariant(y))
}}}
The difference in behaviour is probably due different SIP/PyQt4 versions
on your systems: one might support automatic conversion from QString to
QVariant, while the other doesn't.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2378#comment:5>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list