Hello list,
The following code is running perfectly inside Qgis (1.7.2) from the python
console :
from PyQt4 import QtCore, QtGui
uri = QgsDataSourceURI()
uri.setDatabase( "C:/APPLI_PDT/CANAL_DEV/bd_canal.sqlite")
uri.setDataSource( "", "AOT_POINT", "GEOMETRY" )
layer = QgsVectorLayer( uri.uri(), "AOT", "spatialite" )
provider = layer.dataProvider()
feat = QgsFeature()
geometry = QgsGeometry()
feat.setAttributeMap({1:QtCore.QVariant(5)})
feat.setGeometry(geometry.fromPoint(QgsPoint(990650,110807)))
(res, outFeats) = provider.addFeatures( [ feat ] )
print str(res)
True
But outside it's failing (in my app build with python, PyQt and PyQgis).
Res is set to false, and no row was insert.
I've spent lots of time with Google, but didn't found anything...
Any help should be welcome.
Sylvain
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user