from PyQt5.QtWidgets import QAction, qApp # create a new action my_action = QAction("My Action", qApp.mainWindow()) # set the 'What's This' description for the action my_action.setWhatsThis("This is my custom action that does something interesting.")
from qgis.utils import iface # get an existing action from the QGIS interface zoom_in_action = iface.actionZoomIn # set a 'What's This' description for the action zoom_in_action.setWhatsThis("Zoom in to the map view.")In this example, we get an existing QAction from the QGIS interface (in this case, the 'Zoom In' action), and set its 'What's This' description to provide more information about what the action does.