How to change and display the plugins icon in the menu in QGIS

المشرف العام

Administrator
طاقم الإدارة
I want to add multiple icons in the same file to display the pluins icons in the menu.

def initGui(self): action = self.add_action( ':/plugins/Example/icons\icon1.png', text=self.tr(u'Example'), callback=self.ExampleMethod, parent=self.iface.mainWindow(), checkable=True, toolbar=self.ExampleToolbar) self.ExampleMethod = QgsMapTool(self.iface.mapCanvas()) self.ExampleMethod.setAction(action) action = self.add_action( ':/plugins/Example/icons\icon2.png', text=self.tr(u'Example1'), callback=self.ExampleMethod1, parent=self.iface.mainWindow(), checkable=True, toolbar=self.ExampleToolbar) self.ExampleMethod1 = QgsMapTool(self.iface.mapCanvas()) self.ExampleMethod1.setAction(action) BUt the problem that the icons are not displaying.

I have used make clean and make commands I have updated in the rsources.qrc file also.

What i have to do is to dispaly the icons in the menu?



أكثر...
 
أعلى