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 <[email protected]>:

> 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
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to