[Qgis-developer] API break

Martin Dobias wonder.sk at gmail.com
Mon Mar 17 07:28:35 PDT 2014


Hi Denis

On Mon, Mar 17, 2014 at 8:52 PM, Denis Rouzaud <denis.rouzaud at gmail.com> wrote:
> Hi all,
>
> I noticed an API break has been introduced after 2.2:
>
> 2.2: void QgsSingleSymbolRendererV2::startRender( QgsRenderContext& context,
> const QgsVectorLayer *vlayer );
> 2.3: void QgsSingleSymbolRendererV2::startRender( QgsRenderContext &
> context, const QgsFields &  fields );
>
> I was using this in a plugin to determine if a feature was rendered or not.
>
> This was introduced by Martin for multi-threading
> https://github.com/qgis/QGIS/commit/2fcf556c3cb9c2618753adee390bf84a5ead4775

The prototype with QgsVectorLayer as an argument is still available in
master and it calls the other version with QgsFields argument, so in
theory you should be still able to use the version with
QgsVectorLayer. If not, it is a bug (supposedly related to shadowing
of virtual methods with the same name).

The change should only matter to implementations of renderers, which I
believe are very rare in third-party code, and therefore somewhat a
bit more acceptable to break if there is no chance to fix it without a
break.

> Although I believe that for such a change, some breaks were acceptable.
> Anyway, it would be nice to have this documented at some place. If it is, I
> did not find it.

I have a list of such changes which I would like to document with more
in-depth docs of the MTR implementation. I hope to get it ready for/at
hackfest.

Regards
Martin


More information about the Qgis-developer mailing list