action = QAction("Open", self) action.setIcon(QIcon("open.png"))
self.actionSave = QAction(QIcon("save.png"), "Save", self)In this example, we create a QAction object with the name "Save" and set its icon to the file "save.png". We also specify the parent widget for the action. Package Library: PyQt5.QtWidgets Note: This method is used in conjunction with other PyQt5 widgets to create a graphical user interface in QGIS.