I try to add a wms-Layer to QGIS Desktop from my plugin(c++)
QString uri= "crs=EPSG:28992&layers=natura2000:natura2000&styles=&format=image/png&url=http://geodata.nationaalgeoregister.nl/natura2000/ows?
QString myProviderName = "wms";
QgsRasterLayer* lyr= mQGisIface->addRasterLayer(uri ,"test", myProviderName);
But in QGis i get the Message, the extent of the layer could not be calculated because of unknown dataprovider.
What do i wrong? In QGIs Desktop manually adding this wms-layer is possible without problems. I also tested several other wms with same result.
Thanks for all help.