* \if ENGLISH * @brief Create an action with text, icon, and object name * @param text Action text * @param iconPath Icon path * @param objName Object name * @return Created action pointer * @details This is a helper function to create QAction objects with consistent settings. * The object name is important for action management and customization. * \endif * * \if CHIN
| 2947 | * \endif |
| 2948 | */ |
| 2949 | QAction* MainWindow::createAction(const QString& text, const QString& iconPath, const QString& objName) |
| 2950 | { |
| 2951 | QAction* newAction = new QAction(this); |
| 2952 | newAction->setText(text); |
| 2953 | newAction->setIcon(QIcon(iconPath)); |
| 2954 | newAction->setObjectName(objName); |
| 2955 | return newAction; |
| 2956 | } |
| 2957 | |
| 2958 | /** |
| 2959 | * \if ENGLISH |
no test coverage detected