[Qgis-developer] QgsMapLayerRegistry (and QgsMapCanvas) problem

Martin Dobias wonder.sk at gmail.com
Sat Oct 18 07:12:36 EDT 2008


On Fri, Oct 17, 2008 at 11:31 PM, Tim Sutton <tim at linfiniti.com> wrote:
> Regarding c) they should all be returning enumerated types but I guess
> the side effect is that the QgsMapLayer::type() enumerators and those
> of teh first two entries in QgsVectorLayer::type() return  matchin
> numbers. I could force them to be higher no's to remove such
> inadvertant collisions. I'll take a look at this later tomorrow -
> thanks for the feedback on this.

AFAIK python doesn't support enumerations, you get an integer instead.
SIP generates objects for enumerations, so you can use e.g.
QgsMapLayer.VectorLayer instead of numbers.

Tim, please rename vector layer's type() either back to vectorType()
or some other name to avoid override.


> Any other comments on API changes as I do them are welcome...

I was not happy with all the renaming taking place, but generally
they're fine. One thing I don't really like is that
QgsVectorDataProvider::reset() was renamed to begin(). The real
purpose of this function is to restart reading of the data, one
doesn't have to call it when starting retrieval of features - but
that's what the current name suggest. I would suggest using e.g.
resetReading() as it better corresponds with the action it takes (and
stays consistent with OGR).

bye
Martin


More information about the Qgis-developer mailing list