On Tue, 23 Jan 2018 at 22:34, Enrico Ferreguti wrote:
>
> I'm trying to programmatically set a QgsLayoutPicture content in QGIS3.0:
>
> 1) I create a new print composition and I name it 'test'
> 2) I create a picture frame in the composition and I call it 'picture'
> 3) I run the following code:
On 24 January 2018 at 19:20, Etienne Trimaille
wrote:
> Is-it possible to remove this function from SIP bindings? According to SIP
> version?
>
Unfortunately I don't think this would help - we'd have to remove
every method which returns a QgsLayoutItem to do so - and
I'm testing the code under QGIS3, but I fear that
isinstance(item, item_class), in my case: isinstance(item,
QgsLayoutItemPicture)
returns always false because item is of QgsLayoutItem generic class
Nyall's workaround works for me without exceptions:
from qgis.core import QgsProject,
Is-it possible to remove this function from SIP bindings? According to SIP
version?
It's a common issue, already raised on the mailing list and in plugin issue
trackers.
I'm copy/pasting another message/snippet from Martin which works perfectly:
Not sure if that is related, was just looking
On 23 January 2018 at 22:34, Enrico Ferreguti wrote:
> I'm trying to programmatically set a QgsLayoutPicture content in QGIS3.0:
>
> 1) I create a new print composition and I name it 'test'
> 2) I create a picture frame in the composition and I call it 'picture'
> 3) I run
2018-01-23 14:34 GMT+02:00 Enrico Ferreguti :
> from qgis.core import QgsProject
> myLayout = QgsProject.instance().layoutManager().layoutByName('test')
> myLayoutPicture = myLayout.itemById("picture")
> myLayoutPicture.setPicturePath("path to an image")
>
> and I get the
On Tue, Jan 23, 2018 at 1:34 PM, Enrico Ferreguti
wrote:
> I'm trying to programmatically set a QgsLayoutPicture content in QGIS3.0:
>
> 1) I create a new print composition and I name it 'test'
> 2) I create a picture frame in the composition and I call it 'picture'
> 3) I
I'm trying to programmatically set a QgsLayoutPicture content in QGIS3.0:
1) I create a new print composition and I name it 'test'
2) I create a picture frame in the composition and I call it 'picture'
3) I run the following code:
from qgis.core import QgsProject
myLayout =