MCPcopy Create free account
hub / github.com/czyt1988/SARibbon / createAction

Method createAction

example/MainWindowExample/mainwindow.cpp:2949–2956  ·  view source on GitHub ↗

* \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

Source from the content-addressed store, hash-verified

2947 * \endif
2948 */
2949QAction* 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

Callers 1

createCategoryOtherMethod · 0.95

Calls 2

setTextMethod · 0.45
setIconMethod · 0.45

Tested by

no test coverage detected