Skip to main content
Post Closed as "Not suitable for this site" by underdark
deleted 9 characters in body
Source Link
Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.

Thanks.

Edit: my qrc file : <RCC> <qresource prefix="/plugins/ViewshedAnalysis" > <file>icon.png</file> </qresource> </RCC>

<RCC>
    <qresource prefix="/plugins/ViewshedAnalysis" >
        <file>icon.png</file>
    </qresource>
</RCC>

and my code :

`   self.action = QAction(
            QIcon(":/plugins/ViewshedAnalysis/icon.png"),
            u"Viewshed", self.iface.mainWindow())
    QObject.connect(self.action, SIGNAL("triggered()"), self.run)


    # Add toolbar button and menu item
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginToMenu(u"&Viewshed Analysis", self.action)

`

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.

Thanks.

Edit: my qrc file : <RCC> <qresource prefix="/plugins/ViewshedAnalysis" > <file>icon.png</file> </qresource> </RCC>

and my code :

`   self.action = QAction(
            QIcon(":/plugins/ViewshedAnalysis/icon.png"),
            u"Viewshed", self.iface.mainWindow())
    QObject.connect(self.action, SIGNAL("triggered()"), self.run)


    # Add toolbar button and menu item
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginToMenu(u"&Viewshed Analysis", self.action)

`

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.

Thanks.

Edit: my qrc file :

<RCC>
    <qresource prefix="/plugins/ViewshedAnalysis" >
        <file>icon.png</file>
    </qresource>
</RCC>

and my code :

self.action = QAction(
        QIcon(":/plugins/ViewshedAnalysis/icon.png"),
        u"Viewshed", self.iface.mainWindow())
QObject.connect(self.action, SIGNAL("triggered()"), self.run)


# Add toolbar button and menu item
self.iface.addToolBarIcon(self.action)
self.iface.addPluginToMenu(u"&Viewshed Analysis", self.action)
edited tags
Link
Matthias Kuhn
  • 28.2k
  • 3
  • 89
  • 130
added 559 characters in body
Source Link
Zoran
  • 302
  • 2
  • 13

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.

Thanks.

Edit: my qrc file : <RCC> <qresource prefix="/plugins/ViewshedAnalysis" > <file>icon.png</file> </qresource> </RCC>

and my code :

`   self.action = QAction(
            QIcon(":/plugins/ViewshedAnalysis/icon.png"),
            u"Viewshed", self.iface.mainWindow())
    QObject.connect(self.action, SIGNAL("triggered()"), self.run)


    # Add toolbar button and menu item
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginToMenu(u"&Viewshed Analysis", self.action)

`

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.

Thanks.

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.

Thanks.

Edit: my qrc file : <RCC> <qresource prefix="/plugins/ViewshedAnalysis" > <file>icon.png</file> </qresource> </RCC>

and my code :

`   self.action = QAction(
            QIcon(":/plugins/ViewshedAnalysis/icon.png"),
            u"Viewshed", self.iface.mainWindow())
    QObject.connect(self.action, SIGNAL("triggered()"), self.run)


    # Add toolbar button and menu item
    self.iface.addToolBarIcon(self.action)
    self.iface.addPluginToMenu(u"&Viewshed Analysis", self.action)

`

Source Link
Zoran
  • 302
  • 2
  • 13
Loading