2

I'm trying to upgrade multiPrint plug in to QGIS3, but I'm newbie on python

My upgrade return an error like:

AttributeError: 'QgisInterface' object has no attribute 'activeComposers'

activeComposer no more exist in QGIS3

The code:

def populateComposerList(self):
    #called to populate field list for WHERE statement
    wdgt=self.dlg.composerList
    wdgt.clear()
    for cView in self.iface.activeComposers ():
        item=QListWidgetItem()
        item.setFlags(item.flags() | Qt.ItemIsUserCheckable)
        item.setCheckState(Qt.Unchecked)
        item.setText(cView.composerWindow().windowTitle())
        wdgt.addItem(item)
    wdgt.sortItems()
Jochen Schwarze
  • 14,605
  • 7
  • 49
  • 117
felix
  • 21
  • 1
  • 1
  • Welcome to GIS.SE! It's not unlikely that a method has been removed or replaced in QGIS 3, I recommend intense study of https://qgis.org/api/api_break.html (https://qgis.org/api/api_break.html#qgis_api_break_3_0_Composer) and in this special case https://qgis.org/api/classQgisInterface.html and https://qgis.org/api/classQgsLayout.html – Jochen Schwarze Feb 07 '19 at 11:07
  • Hi,Thanks for all this links. In another forum, somone tell me about another plug-in like mine: Maps printer. This one done what I want. Thanks again – felix Feb 07 '19 at 13:26

0 Answers0