<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">W dniu 23.10.2015 o 18:54, Emilio S
pisze:<br>
</div>
<br>
<blockquote cite="mid:DUB130-W1703FC27C507B6B2E543B0D2260@phx.gbl"
type="cite">
<div dir="ltr">I have tried to connect to spatialite with this
code, but this doesn´t add anything. Could you know why?</div>
</blockquote>
<br>
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)<br>
<br>
<blockquote cite="mid:DUB130-W1703FC27C507B6B2E543B0D2260@phx.gbl"
type="cite">
<div dir="ltr"><i>display_name=('prueba')</i>
<div>
<div><i>vlayer=QgsVectorLayer(uri.uri(), display_name,
'spatialite')</i></div>
</div>
</div>
</blockquote>
<br>
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.<br>
</body>
</html>