[Qgis-user] error loading python qgis plugin

Michele Ferretto michele.ferretto at tiscali.it
Sat Aug 23 07:51:19 PDT 2008


def initGui(self):
    # create action that will start plugin configuration
    self.action = QAction(QIcon(":/plugins/testplug/icon.xpm"), "Geocode
Addresses", self.iface.getMainWindow())
    self.action.setWhatsThis("Geocoder plugin")
    QObject.connect(self.action, SIGNAL("activated()"), self.run)

    # add toolbar button and menu item
    print 'michele:'
    print self.action
    print self.iface.addToolBarIcon
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginMenu("&Geocoder", self.action)

    # connect to signal renderComplete which is emitted when canvas
rendering is done
    QObject.connect(self.iface.getMapCanvas(),
SIGNAL("renderComplete(QPainter *)"), self.renderTest)


Ron Bentley wrote:
>> Traceback (most recent call last):
>>   File "", line 1, in
>>   File "/home/iron/.qgis//python/plugins/geocode/geocodeplugin.py", line
>> 30, in initGui
>>     self.iface.addToolBarIcon(self.action)
>> TypeError: argument 1 of QgisInterface.addToolBarIcon() has an invalid
>> type
> 
> Michele,
> 
> Could you post the entire "def initGui" section, particularly the part
> where you instantiate self.action?
> 
> And, I'm sorry to hijack your thread, but you mentioned another problem:
> 
>> I  have posted the same issue in the forum, without any reply
> 
> The forums seem to have been surrendered to the spammers -- at least the
> plugin forum.  Can the old-timers around here comment?  For those of us
> who have begun to watch the forum, is there any point in even tagging
> the spam?
> 
> Ron Bentley
> 



More information about the Qgis-user mailing list