[Qgis-developer] Python: viewing properties for an ComposerItem programmatically?

Luca Manganelli luca76 at gmail.com
Wed Sep 24 07:32:26 PDT 2014


Hi, (i'm using qgis 2.4)

how can view the object properties of a composer item I added with my plugin?
I tried with showItemOptions(...) but it doesn't work

in this example, I add a composerMap, but I cannot find a way on how
to automatically view the properties in the Composer Window:

# open the composer that I created
composition = composerView.composition()
composer = composerView.composerWindow()
composer.show()

# now I create and add the map
composerMap = QgsComposerMap(composition, 0, 0, float(paperwidth),
float(paperheight))
composition.addComposerMap(composerMap)

# add the command to history
composition.pushAddRemoveCommand( composerMap, "New map added" )

composerMap.setSelected(True)
composerView.setComposition(composition)
composition.update()

# these commands doesn't show the item properties
composerView.selectedItemChanged.emit(composerMap) # doesn't work
composer.showItemOptions ( composerMap ) # doesn't work


More information about the Qgis-developer mailing list