[Qgis-developer] Using app MessageBar from providers ?

Even Rouault even.rouault at spatialys.com
Mon Apr 11 08:00:38 PDT 2016


Le lundi 11 avril 2016 16:25:58, Matthias Kuhn a écrit :
> Can't you emit a raiseError(QString) from the dataprovider for this?

Oh, I didn't realize that existed. Thanks ! I'll have to do some signal 
forwarding since the error is emitted from an object that is a bit 
disconnected from the provider itself, but that should be doable.

Testing quickly, I see that pushError() only pushes to the message bar and not 
the message log. Is it really intended ?

Another potential issue with the current implementation, that isn't a problem 
in my current use case, is that pushError() is without effect if called from 
the provider constructor, since the raiseError() signal of the provider can of 
course be forwarded to the layer raiseError() only after construction. 
Probably that QgsVectorLayer::setDataProvider() should examine the list of 
errors just after constructing the data provider and raise them.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the Qgis-developer mailing list