[Qgis-developer] SIP API Update merged. Attention plugin authors
Nathan Woodrow
madmanwoo at gmail.com
Sun Jun 9 01:47:06 PDT 2013
On Sun, Jun 9, 2013 at 6:27 PM, Borys Jurgiel <lists at borysjurgiel.pl> wrote:
> Actually no breaking change happened now, there would be just MUCH more
> switches (assuming that e.g. each formerly QString-type variable may be
> either
> QString or unicode). So in the simplest plugins you can still use them and
> make the plugin dual-API-compatible. Just remember to explicitly set both
> qgisMinimumVersion and qgisMaximumVersion, otherwise QGIS assumes
> qgisMaximumVersion at 1.9
>
Technically this can be done for smaller plugins like Borys said.
Something like:
import sip
if sip.getapi("QVariant") > 1:
# Use the new API style
else:
# Use the old API style
Unless you have a small amount of code, say a small script, I would avoid
this because you would have to do it around every method that returns
QString or QVariant, which would not be nice and make your life harder.
- Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130609/b430b3c7/attachment.html>
More information about the Qgis-developer
mailing list