[Qgis-user] QGIS plugin with python
Emil Oppeln-Bronikowski
emil at fuse.pl
Fri Oct 23 13:00:05 PDT 2015
W dniu 23.10.2015 o 18:54, Emilio S pisze:
> I have tried to connect to spatialite with this code, but this doesn´t
> add anything. Could you know why?
I'm just starting my QGIS adventure, so don't take my word for it (I'm
pretty decent Python programmer, but I don't know QGIS API fully yet)
> /display_name=('prueba')/
> /vlayer=QgsVectorLayer(uri.uri(), display_name, 'spatialite')/
From what I observed QgsVectorLayer takes QString as a second
parameter. Try it with a simple string, it works when I crack on
ShapeFiles. Also, you can test layer objects with isValid() method, see
if it turns True or False.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20151023/a725f271/attachment.html>
More information about the Qgis-user
mailing list