[Qgis-developer] Software development usig QGis API and Qt

Alper Colak alpercolak at gmail.com
Tue Feb 3 22:48:17 PST 2015


Solved it.
It seems we have to initialize QgsProviderRegistry with valid plugin
directory path.

    QString myPluginsDir        = "/usr/lib/qgis/plugins";
    QgsProviderRegistry::instance(myPluginsDir);

Still can't see the raster but at least I passed the "isValid" problem.

2015-02-03 18:34 GMT+02:00 Matthias Ludwig <kaotika at gmx.de>:

> I'am have no experiences with writin C++ apps but on the python side you
> have to set the prefix paths and init qgis at app start. Otherwise you'll
> get strange errors, like yours.
>
> QgsApplication.prefixPath() --> get your path from a working QGIS python
> console
>
> QgsApplication.setPrefixPath(<path>, True)
> QgsApplication.initQgis()
>
> Hope this helps.
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150204/c93eb8a5/attachment.html>


More information about the Qgis-developer mailing list