Skip to content

Commit

Permalink
Gui: add new API GroupCommand::getCommands()
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Apr 30, 2022
1 parent b48554b commit d40edbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Gui/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,16 @@ Command *GroupCommand::getCommand(int idx) const
return nullptr;
}

std::vector<Command*> GroupCommand::getCommands() const
{
std::vector<Command*> res;
for (const auto &v : cmds) {
if (v.first)
res.push_back(v.first);
}
return res;
}

Action * GroupCommand::createAction(void) {
ActionGroup* pcAction = new ActionGroup(this, getMainWindow());
pcAction->setMenuRole(QAction::NoRole);
Expand Down
1 change: 1 addition & 0 deletions src/Gui/Command.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ class GuiExport GroupCommand : public Command {
Command *addCommand(const char *cmdName);

Command *getCommand(int idx) const;
std::vector<Command*> getCommands() const;

virtual void refreshIcon();

Expand Down

0 comments on commit d40edbc

Please sign in to comment.