[Qgis-developer] API Break in 2.16 for QgsComposition

Sandro Mani manisandro at gmail.com
Tue Jul 19 14:23:48 PDT 2016



On 16.07.2016 01:20, Nyall Dawson wrote:
> On 15 July 2016 at 03:40, Tim Sutton <tim at kartoza.com> wrote:
>> Hi All
>>
>> It seems like something broke in QgsComposition (in 2.16 and master) - we have some code like this:
>>
>> logo = self.composition.getComposerItemById('logo')
>> logo.setPicturePath(self.logo_path)
>>
>>
>> Which fails saying that QgsCompositionItem has no method setPicturePath. This used to work fine in 2.14 - has anyone else encountered this? I know we are breaking API post 2.16 but it would be great if this still behaved right - or if someone could indicate the preferred way to do this now?
> Is this specific to composer items? Or does all sip casting fail? (ie,
> try retrieving a symbol layer from a renderer... is it correctly cast
> to QgsSimpleFillLayerV2/etc or just left at the generic
> QgsSymbolLayerV2?)
I similar issue:

class MyTool(QgsMapTool):
     def __init__(self, canvas):
         QgsMapTool.__init__(self, canvas)

     def canvasReleaseEvent(self, e):
         print "Release: %d,%d" % (e.x(), e.y())

iface.mapCanvas().setMapTool(MyTool(self.iface.mapCanvas()))

-> The canvasReleaseEvent of the base class is fired, the overriding 
method is ignored.


More information about the Qgis-developer mailing list