QMenu *menu = new QMenu("File"); QAction *saveAction = new QAction("Save", menu); saveAction->setIcon(QIcon(":/images/save.png")); // Set the icon for the "Save" action menu->addAction(saveAction);In this example, we create a new QMenu object called "File" and then create a new QAction object to represent the "Save" option. We then use setIcon() to add an icon to the "Save" action. Finally, we add the action to the menu using addAction(). The package library that contains the QMenu class is the Qt Core library.