src/eric7/EricWidgets/EricIconBar.py

branch
eric7
changeset 10500
40fc136e7002
parent 10439
21c28b0f9e41
child 11090
f5f5f5803935
--- a/src/eric7/EricWidgets/EricIconBar.py	Sat Jan 13 13:01:09 2024 +0100
+++ b/src/eric7/EricWidgets/EricIconBar.py	Sun Jan 14 12:39:11 2024 +0100
@@ -342,6 +342,19 @@
 
             self.__adjustIconLabels()
 
+    def setIcon(self, index, icon):
+        """
+        Public method to set the icon at the given index.
+
+        @param index icon index
+        @type int
+        @param icon reference to the icon
+        @type QIcon
+        """
+        labelItem = self.__layout.itemAt(index)
+        if labelItem:
+            labelItem.widget().setPixmap(icon.pixmap(self.__barSize, self.__barSize))
+
     @pyqtSlot()
     def __iconClicked(self, label):
         """

eric ide

mercurial