#includeIn this example, the two QAction objects are created and added to the menu using the addAction function. However, the setActionGroup function is called on each action to add them to the same group. This ensures that only one of the actions can be active at a time. The Qt framework provides the QAction and QActionGroup classes, which can be found in the QtWidgets package library.#include // Create a menu and QActionGroup QMenu* menu = new QMenu("My Menu"); QActionGroup* group = new QActionGroup(this); // Create two QAction objects and add them to the group QAction* action1 = new QAction("Action 1", this); action1->setActionGroup(group); menu->addAction(action1); QAction* action2 = new QAction("Action 2", this); action2->setActionGroup(group); menu->addAction(action2);